ta-tikoma/phpins

防止 PHP 类中的愚蠢错误

1.0.0 2020-03-02 11:01 UTC

This package is auto-updated.

Last update: 2024-08-29 04:54:57 UTC


README

#EN

phpins

防止愚蠢的错误,例如:忘记指定类的连接

验证器

IDefinedThisVariable - 检测变量定义位置 INotForgottenAddUseThisClass - 检测文件中所有类的 "use" 设置 INotUseCyrillicLetterC - 检测代码中的西里尔字母 "c"

安装

  1. 安装 composer
  2. 使用以下命令安装 phpins
composer global require ta-tikoma/phpins

使用

phpins -f {file-path}

示例输出

RemoveDownLineIndex.php:
  WARNING:RemoveDownLineIndex.php:5:18:Class not use "FormData"
  WARNING:RemoveDownLineIndex.php:7:18:Class not use "EntityManagerInterface"
  WARNING:RemoveDownLineIndex.php:8:32:Class not use "Auth"

翻译

EN RU