marius/phplint
Composer 安装命令:
composer require marius/phplint
包简介
a php syntax check tool. Forked from Overtrue
README 文档
README
phplint is a tool that can speed up linting of php files by running several lint processes at once.
Installation
$ composer require overtrue/phplint -vvv
Usage
CLI
Usage: phplint [options] [--] <path> (<path>)... Arguments: path Path to file or directory to lint. Options: --exclude=EXCLUDE Path to file or directory to exclude from linting (multiple values allowed) --extensions=EXTENSIONS Check only files with selected extensions (default: php) -j, --jobs=JOBS Number of parraled jobs to run (default: 5) -c, --configuration=CONFIGURATION Read configuration from config file (default: ./.phplint.yml). --no-configuration Ignore default configuration file (default: ./.phplint.yml). --no-cache Ignore cached data. -h, --help Display this help message -q, --quiet Do not output any message -V, --version Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output -n, --no-interaction Do not ask any interactive question -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug Help: Lint something
example:
$ ./vendor/bin/phplint ./ --exclude=vendor
You can also define configuration as a file .phplint.yml:
path: ./ jobs: 10 extensions: - php exclude: - vendor
$ ./vendor/bin/phplint
By default, the command will read configuration from file .phplint.yml of path specified, you can custom the filename by option: --configuration=FILENAME or -c=FILENAME;
if you want do disabled any config file, you can add option --no-configuration.
Program
use Overtrue\PHPLint\Linter; $path = __DIR__ .'/app'; $exclude = ['vendor']; $extensions = ['php']; $linter = new Linter($path, $exclude, $extensions); // get errors $errors = $linter->lint(); // // [ // '/path/to/foo.php' => [ // 'error' => "unexpected '$key' (T_VARIABLE)", // 'line' => 168, // 'file' => '/path/to/foo.php', // ], // '/path/to/bar.php' => [ // 'error' => "unexpected 'class' (T_CLASS), expecting ',' or ';'", // 'line' => 28, // 'file' => '/path/to/bar.php', // ], // ]
License
MIT
marius/phplint 适用场景与选型建议
marius/phplint 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 45 次下载、GitHub Stars 达 0, 最近一次更新时间为 2017 年 09 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「syntax」 「check」 「lint」 「phplint」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 marius/phplint 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 marius/phplint 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 marius/phplint 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Generate reports from lint results
Bookdown.io With Bootswatch Styles And Prism Syntax Highlighting
A Symfony bundle for chameleon-system/sanitycheck
PHP linting rules set used by Opay developers
This is the ZooRoyal coding standard.
This Extension integrates a credit check and more made by the LEONEX Risk Management Platform into your order process. Extensive configuration and evaluation options is provided in the Platform
统计信息
- 总下载量: 45
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-09-14