The deletion of code from the code base is itself a very daring task. Asking a programmer to delete business logic in the code is like asking for one of the kidneys!
PhpStorm attempts to ease this by providing a Safe Delete option. You can delete an element in your code by refactoring it. This refactoring will find the occurrences of the selected element, and as soon as you ask it to proceed, PhpStorm happily deletes the selected occurrences of the element in your project.
To delete a file, you need to follow these steps:
Access the right-click context menu after placing the cursor over the target filename.
Choose the Safe Delete option. PhpStorm then asks you whether you want to look into the comments and strings inside your code, as shown in the following screenshot:
If you continue, PhpStorm will let you know of any potential problems in deleting the file.
You can then have a look at the list of files that are under the radar by selecting the View...