mnib-dev / coding-standard
个人编码规范,基于 Doctrine 编码规范。
v0.1.5
2023-08-12 12:54 UTC
Requires
- php: ^7.3 || ^8.0.2
- dealerdirect/phpcodesniffer-composer-installer: ^0.6.2 || ^0.7
- friendsofphp/php-cs-fixer: ^3.2.1
- slevomat/coding-standard: ^6.3 || ^7.0 || ^8.0
- squizlabs/php_codesniffer: ^3.6
README
创建一个名为 .php_cs.dist
的文件,并包含以下内容
<?php declare(strict_types=1); $finder = PhpCsFixer\Finder::create() ->in(__DIR__ . '/src') ->ignoreDotFiles(true) ->ignoreVCS(true) ->files() ->name('*.php') ; return (new MNIB\CsFixer\Config()) ->setFinder($finder) ->setRiskyAllowed(true) ->addRules([ 'declare_strict_types' => true, 'strict_comparison' => true, 'strict_param' => true, 'string_line_ending' => true, ]) ;