antipodes/php-cs-fixer-config-antipodes
Composer 安装命令:
composer require antipodes/php-cs-fixer-config-antipodes
包简介
Provides a configuration factory and multiple rule sets for Antipodes Medical.
README 文档
README
composer require antipodes/php-cs-fixer-config-antipodes --dev
Usage
Configuration
Pick one of the rule sets:
Create a configuration file .php-cs-fixer.dist.php in the root of your project:
<?php use PhpCsFixer\Finder; use Antipodes\PhpCsFixer\Config\Factory; use Antipodes\PhpCsFixer\Config\RuleSet\Php74; $config = Factory::fromRuleSet(new Php74()); $finder = Finder::create() ->in([ __DIR__, ]) ->name('*.php') ->ignoreDotFiles(true) ->ignoreVCS(true); return $config ->setFinder($finder) ->setRiskyAllowed(true) ->setUsingCache(true);
Configuration with override rules
💡 Optionally override rules from a rule set by passing in an array of rules to be merged in:
<?php use PhpCsFixer\Finder; use Antipodes\PhpCsFixer\Config\Factory; use Antipodes\PhpCsFixer\Config\RuleSet\Php74; -$config = Factory::fromRuleSet(new Php74()); +$config = Factory::fromRuleSet(new Php74(), [ + 'mb_str_functions' => false, + 'strict_comparison' => false, +]); $finder = Finder::create() ->in([ __DIR__, ]) ->name('*.php') ->ignoreDotFiles(true) ->ignoreVCS(true); return $config ->setFinder($finder) ->setRiskyAllowed(true) ->setUsingCache(true);
Composer script
If you like composer scripts, add a coding-standards script to composer.json:
{
"name": "foo/bar",
"require": {
"php": "^7.3",
},
"require-dev": {
"antipodes/php-cs-fixer-config-antipodes": "~1.0.0"
+ },
+ "scripts": {
+ "lint": [
+ "./vendor/bin/php-cs-fixer fix -vvv --dry-run --show-progress=dots"
+ ],
+ "lint:fix": [
+ "./vendor/bin/php-cs-fixer fix -vvv --show-progress=dots"
+ ]
}
}
Run
composer lint
to lint the code.
Run
composer lint:fix
to automatically fix the code.
GitHub Actions
If you like GitHub Actions, add a php-lint job to your workflow:
name: "🚨 PHP Linter" on: push: branches: - master pull_request: branches: - master jobs: php: name: PHP ${{ matrix.php }} runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[ci skip]')" strategy: fail-fast: false matrix: php: [ "7.4", "8.0" ] steps: - name: Checkout the project uses: actions/checkout@v2 - name: Setup the PHP ${{ matrix.php }} environment on ${{ runner.os }} uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - name: Add HTTP basic auth credentials run: echo '${{ secrets.COMPOSER_AUTH_JSON }}' > $GITHUB_WORKSPACE/auth.json - name: Install Composer dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader --no-suggest - name: Execute the lint script run: composer run-script lint
antipodes/php-cs-fixer-config-antipodes 适用场景与选型建议
antipodes/php-cs-fixer-config-antipodes 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.97k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 03 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 antipodes/php-cs-fixer-config-antipodes 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 antipodes/php-cs-fixer-config-antipodes 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 3.97k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-03-16