我目前php vendor/bin/phpcs --standard=PSR12 src
在我的几个项目的 CI 中运行。
他们已经失败了 6 个多月,因为我的代码组织如下:
<?php declare(strict_types=1);
/**
* This file is part of SimpleDTO, a PHP Experts, Inc., Project.
*
* Copyright © 2019 PHP Experts, Inc.
* Author: Theodore R. Smith <theodore@phpexperts.pro>
* GPG Fingerprint: 4BF8 2613 1C34 87AC D28F 2AD8 EB24 A91D D612 5690
* https://www.phpexperts.pro/
* https://github.com/phpexpertsinc/SimpleDTO
*
* This file is licensed under the MIT License.
*/
namespace PHPExperts\SimpleDTO;
它目前会生成几个 PHPCS 警告:
--------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------
1 | ERROR | [x] Header blocks must be separated by a single blank line
1 | ERROR | [x] Opening PHP tag must be on a line by itself
3 | ERROR | [ ] The file-level docblock must follow the opening PHP tag in the file header
--------------------------------------------------------------------------------------------
有没有办法保留 PSR-12 的其余检查,但不是那些?