pandaleague/kohana-coding-standards
Composer 安装命令:
composer require pandaleague/kohana-coding-standards
包简介
PHP_CodeSniffer rules for the Kohana Framework coding style
README 文档
README
This package contains a set of coding standard tests for the kohana PHP framework.
The original tests were written by Matthew Turland, see his github repo for more info.
These tests are meant to be a guide and may not be 100% accurate. If you find a bug please report it on the kohana issue tracker.
Requirements
These tests are built for usage with PHP Codesniffer.
Installation - Composer
Add the package to the development dependencies in your project's composer.json
{
"require-dev": {
"kohana/coding-standards": "*",
}
}
Run composer --dev update to update your composer.lock file and install the package. The sniffs will be installed in
vendor/kohana/coding-standards in your project root directory and the phpcs command will be installed to bin/phpcs.
Installation - Manually or with PEAR
If you want the standard to be available system wide you can symlink them into the code sniffer dir like so:
git clone https://github.com/kohana/coding-standards.git kohana-coding-standards
cd kohana-coding-standards
sudo ln -sfn `pwd`/Kohana `pear config-get php_dir`/PHP/CodeSniffer/Standards/Kohana
sudo ln -sfn `pwd`/test/PHP_CodeSniffer/CodeSniffer/Standards/Kohana `pear config-get test_dir`/PHP_CodeSniffer/CodeSniffer/Standards/Kohana
Running
If you installed with composer, reference the standard from your vendor directory:
bin/phpcs --standard=vendor/kohana/coding-standards/Kohana modules/
Or, from a raw clone, you can simply reference the local copy:
phpcs --standard=path/to/coding-standards/Kohana kohana/core
If installed globally (symlinked into PEAR), you can reference the standard like so:
phpcs --standard=Kohana application/
Customising your project standard
It is also possible to extend the rules in use for your project, or to include some but not all of the Kohana standards
(for example, if you are working on something that is not intended as a kohana module). You do this by adding a
coding_standard.xml to your project root which specifies which rules to include and customises any variables. See the
PHP_CodeSniffer docs for more
details.
Testing
Like all things code related, sniffs need to be tested! To run the tests they need to be in the codesniffer dir (i.e. you should run the above commands to symlink the sniffs / tests in) and you need to patch phpcs' AllSniffs.php
Then just run the tests like so:
phpunit --bootstrap=`pear config-get php_dir`/PHP/CodeSniffer.php `pear config-get test_dir`/PHP_CodeSniffer/CodeSniffer/Standards/AllSniffs.php
Known issues
- There are some problems with expressions in ternary operators
Please report any new issues to the K3 bug tracker and file it under "PHPCS Coding Standards"
pandaleague/kohana-coding-standards 适用场景与选型建议
pandaleague/kohana-coding-standards 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.99k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 11 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「kohana」 「standards」 「phpcs」 「Code style」 「code standard」 「coding stanards」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 pandaleague/kohana-coding-standards 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 pandaleague/kohana-coding-standards 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 pandaleague/kohana-coding-standards 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Geoip and IP integration
Jam Taxonomy
Admin Builder for Kohana, using Jam ORM
Add complex shipping to openbuildings/purchases package
A php port of jnicklas's capybara, and handles Functional / Integration testing
PHP_CodeSniffer custom Sniff for Laravel coding standard
统计信息
- 总下载量: 1.99k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2020-11-04