Book Image

PhpStorm Cookbook

By : Mukund Chaudhary
Book Image

PhpStorm Cookbook

By: Mukund Chaudhary

Overview of this book

Table of Contents (16 chapters)
PhpStorm Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Deleting elements


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!

Getting ready

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.

How to do it...

To delete a file, you need to follow these steps:

  1. Access the right-click context menu after placing the cursor over the target filename.

  2. 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:

  3. If you continue, PhpStorm will let you know of any potential problems in deleting the file.

  4. You can then have a look at the list of files that are under the radar by selecting the View...