daaarkling/php-add-strict-types-line

用于向PHP文件中添加 `declare(strict_types=1);` 行的命令行脚本

1.0 2018-02-13 23:08 UTC

This package is auto-updated.

Last update: 2024-09-23 02:51:23 UTC


README

用于向PHP文件中添加 declare(strict_types=1); 行的命令行脚本

它使用原生PHP标记化器,因此转换是安全的。它只添加到未找到 declare(strict_types=1); 的文件中。

使用方法

要递归地将整个目录中的所有 *.php*.phpt 文件转换为 *.php,或者要转换单个文件,请使用

php add-line.php <directory | file>