pragmarx/laravelcs
Composer 安装命令:
composer require pragmarx/laravelcs
包简介
PHP_CodeSniffer custom Sniff for Laravel coding standard
README 文档
README
This is a custom Sniff to detect violations and reformat PHP source code based on Laravel Coding Standard.
Your source code will be checked for PSR-1 & the Laravel "flavor" of PSR-2.
Usage wih git
Clone this repository
git clone http://github.com/antonioribeiro/laravelcs LaravelCodeSniffer
Execute CodeSniffer
phpcs --standard=LaravelCodeSniffer/Standards/Laravel/ /path/to/your/project/files
Usage with Composer
The recommended way is to install it globally with the following command:
composer global require pragmarx/laravelcs
Make sure you have ~/.composer/vendor/bin/ in your PATH.
You will then be able to run PHP Code Sniffer with the Laravel Standard:
phpcs --standard=$HOME/.composer/vendor/pragmarx/laravelcs/Standards/Laravel/ /path/to/your/project/files
Testing the Sniff
This Sniff was tested using the Laravel Framework source code and some changes, to comply with PSR-2, were required, click here to see them. Those were the violations found and fixed in Filesystem.php:
--------------------------------------------------------------------------------
FOUND 14 ERRORS AFFECTING 11 LINES
--------------------------------------------------------------------------------
29 | ERROR | [x] Inline control structures are not allowed
44 | ERROR | [x] Inline control structures are not allowed
113 | ERROR | [x] Expected 1 new line after closing parenthesis; found " "
113 | ERROR | [x] Expected 1 newline after opening brace; 0 found
113 | ERROR | [x] Inline control structures are not allowed
113 | ERROR | [x] Closing brace must be on a line by itself
241 | ERROR | [x] Inline control structures are not allowed
247 | ERROR | [ ] Opening brace should be on the same line as the declaration
249 | ERROR | [x] Closing brace indented incorrectly; expected 2 spaces, found 3
310 | ERROR | [x] Inline control structures are not allowed
335 | ERROR | [x] Inline control structures are not allowed
343 | ERROR | [x] Inline control structures are not allowed
361 | ERROR | [x] Inline control structures are not allowed
384 | ERROR | [x] Inline control structures are not allowed
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Contributing
There are probably still a lot to do here, so please, open issues and send pull requests.
pragmarx/laravelcs 适用场景与选型建议
pragmarx/laravelcs 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 112.88k 次下载、GitHub Stars 达 236, 最近一次更新时间为 2014 年 12 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「code」 「laravel」 「standards」 「PHP_CodeSniffer」 「sniffer」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 pragmarx/laravelcs 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 pragmarx/laravelcs 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 pragmarx/laravelcs 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Memio's PrettyPrinter, used to generate PHP code from given Model
A set of abstractions that define core services provided by the DVSA
This is the ZooRoyal coding standard.
Vanio Coding Standard Ruleset for PHP_CodeSniffer.
The coding standard applying to all Youdot PHP projects, based on Doctrine set of PHPCS rules, with additional checks.
Abstractions related to Userbase user Roles
统计信息
- 总下载量: 112.88k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 238
- 点击次数: 9
- 依赖项目数: 3
- 推荐数: 1
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2014-12-09