daaarkling / php-add-strict-types-line
Command-line script for adding `declare(strict_types=1);` line to PHP files
Installs: 145
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
Type:project
Requires
- php: >=5.6
This package is auto-updated.
Last update: 2024-11-23 03:13:55 UTC
README
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>