When writing code, it is common to put the Copyright year at the top of the code. If we haven’t updated the Copyright information by the time the New Year comes, we will be behind. But manual updates or batch replacements can result in a lot of work or errors. To solve this problem, PHPStorm has a great solution which is the copyright auto-update mechanism (plugin).

Add Copyright Copyright

Enter the Settings

Search and find the copyright Settings project (new versions of the IDE are already integrated and do not need to be installed), search and install copyright plug-ins for older versions

The Copyright parameters can be viewed at the official link: Copyright Profiles

Set the copyright Scope

Not all files need the same copyright information, we add the copyright information to the required directory, using PHPstorm’s Scope function.

First set the scope and set it to shared mode

Search scope, find the setting item, select according to folder, exclude and other Settings, and finally check the Share Scope at the bottom

Set the copyright and Scope association

Find the Copyright master Settings project, add and associate

Update the copyright

The important thing to note here is that there is a lookup location in the copyright Settings.

This line means that a comment in the comment will be found by re that matches this rule and updated to the current copyright. The default is Copyright because there must be Copyright in every Copyright notice, and if you don’t have a matching item in your file, the Copyright information will be added at the bottom of the file.

We right-click on the folder where we want to update the copyright information, and the copyright information is updated.

Different language Settings

There are different formats for copyright information in different languages, annotation formats, and different formatting information can be set in menu items according to multiple languages. Experience is very good