struggle-for-php/sfp-psalm-dont-operation-inside-constructor-plugin
Composer 安装命令:
composer require --dev struggle-for-php/sfp-psalm-dont-operation-inside-constructor-plugin
包简介
Dont' operation inside constructor
README 文档
README
$ ./vendor/bin/psalm
Scanning files...
Analyzing files...
░░░░░░░░░░░░░
ERROR: MethodOperationInsideConstructorIssue - src/app/Controllers/BlogController.php:15:9 - 'SplFileInfo::openfile' not allowed inside __construct()
$log->openFile('w+');
ERROR: MethodOperationInsideConstructorIssue - src/app/models/Model.php:26:13 - 'PDO::query' not allowed inside __construct()
$this->pdo->query($query);
------------------------------
2 errors found
------------------------------
Features
- check operation resources
- resource operation function list is provided by struggle-for-php/resource-operations
- fork of sebastianbergmann/resource-operations
Todo
- support flexible setting xml to mark vendor libraries
Disclaimer
this plugin is very experimental status.
Installation
$ composer require --dev struggle-for-php/sfp-psalm-dont-operation-inside-constructor-plugin:dev-master
$ vendor/bin/psalm-plugin enable struggle-for-php/sfp-psalm-dont-operation-inside-constructor-plugin
统计信息
- 总下载量: 133
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-07-11