phpphpstorm

How do you use @deprecated on a script file using PhpStorm?


Currently you can use the @deprecated annotation in classes, but how do I get my files to show a strike-through for script files that aren't attached to a class at all?

Why would you want to do this? Finding unused features and will remove them in another commit, but I want to mark it as a reminder.


Solution

  • I don't think PhpStorm has such feature. But, if the file is to be removed soon, you can make a little hack and just add a dummy class to the file:

    /**
     * @deprecated
     */
    class ThisFileIsDeprecated
    {
    }
    

    Project pane screenshot that shows strike-trough over PHP file