When writing code, we often put the year of Copyright at the top of the code. If it is the New Year, our If the copyright information has not been updated, you will fall behind. However, manual updates or batch replacements will generate a lot of work or errors. In order to solve this problem, PHPStorm has an excellent solution which is the automatic copyright update mechanism (plug-in).
Add CopyrightCopyright
Enter settings
Search and find the copyright setting item (the new version of IDE has been integrated, no installation is required), if it is the old The version needs to search and install the copyright plug-in
Copyright parameters can be viewed at the official link:
Copyright Profiles
Set the copyright scopeScope
Not all files require the same copyright information. We add copyright in the required directory, which uses PHPstorm's Scope function.
First set the scope and set it to sharing mode
Search scope, find the setting item, select according to the folder, exclude and other settings, and finally check theShare Scope at the bottom
Set Copyright and Scope Association
Find the Copyright main setting item, add and associate it
Update Copyright
What needs to be noted here is that there is a search location in the copyright settings.
This One line means to find comments that match this rule according to the regular rules in the comments and update them to the current copyright. The default isCopyright
because the stringCopyright
must exist in every copyright statement. If there is no such matching item in your file, the copyright information will be added at the bottom of the file.
We right-click the folder that needs to update the copyright information, so that the copyright information will be updated.
Settings in different languages
There will be different copyright information formats and comment formats in different languages. Different formatting information can be set according to multiple languages in the menu items. Great experience