Skip to content

Command-line script for adding `declare(strict_types=1);` line to PHP files

License

Notifications You must be signed in to change notification settings

Daaarkling/php-add-strict-types-line

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP add-strict-types-line

Command-line script for adding declare(strict_types=1); line to PHP files

It uses native PHP tokenizer, so conversion is safe. It adds the line only to files where declare(strict_types=1); was not found.

Usage

To convert all *.php and *.phpt files in whole directory recursively or to convert a single file use:

php add-line.php <directory | file>

About

Command-line script for adding `declare(strict_types=1);` line to PHP files

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages