mnib-dev/coding-standard

个人编码规范,基于 Doctrine 编码规范。

安装数量: 3,098

依赖者: 3

建议者: 0

安全性: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:phpcodesniffer-standard

v0.1.5 2023-08-12 12:54 UTC

This package is auto-updated.

Last update: 2024-09-12 15:26:18 UTC


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,
    ])
;