File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828/.git-blame-ignore-revs export-ignore
2929/.gitattributes export-ignore
3030/.gitignore export-ignore
31+ /.php-cs-fixer.dist.php export-ignore
3132/phpcs.xml.dist export-ignore
3233/phpstan-baseline.neon export-ignore
3334/phpstan.dist.neon export-ignore
Original file line number Diff line number Diff line change 1+ name : php-cs-fixer
2+
3+ permissions :
4+ contents : read
5+
6+ on :
7+ pull_request : &ignore-paths
8+ paths-ignore :
9+ - " .github/CONTRIBUTING.md"
10+ - " .github/FUNDING.yml"
11+ - " .github/ISSUE_TEMPLATE.md"
12+ - " .github/PULL_REQUEST_TEMPLATE.md"
13+ - " .github/SECURITY.md"
14+ - " .editorconfig"
15+ - " .git-blame-ignore-revs"
16+ - " .gitattributes"
17+ - " .gitignore"
18+ - " LICENSE.md"
19+ - " README.md"
20+ - " CHANGELOG.md"
21+ - " UPGRADE.md"
22+
23+ push : *ignore-paths
24+
25+ jobs :
26+ php-cs-fixer :
27+ uses : yiisoft/yii2-actions/.github/workflows/php-cs-fixer.yml@9bfbe47bd91bc31a6ff9f0ea77ba3724d7816c3d # master
28+ with :
29+ composer-root-version : 2.0.x-dev
30+ configuration : .php-cs-fixer.dist.php
31+ php-version : ' ["7.4"]'
Original file line number Diff line number Diff line change 1- name : linter
1+ name : phpcs
22
33permissions :
44 contents : read
Original file line number Diff line number Diff line change @@ -46,3 +46,7 @@ phpstan.neon
4646
4747# local phpcs config
4848phpcs.xml
49+
50+ # PHP CS Fixer
51+ .php-cs-fixer.php
52+ .php-cs-fixer.cache
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use PhpCsFixer \Config ;
4+ use PhpCsFixer \Finder ;
5+
6+ $ header = '@link https://www.yiiframework.com/
7+ @copyright Copyright (c) 2008 Yii Software LLC
8+ @license https://www.yiiframework.com/license/ ' ;
9+
10+ $ finder = (new Finder ())
11+ ->in ([
12+ __DIR__ . '/commands ' ,
13+ __DIR__ . '/components ' ,
14+ __DIR__ . '/helpers ' ,
15+ __DIR__ . '/models ' ,
16+ __DIR__ . '/renderers ' ,
17+ __DIR__ . '/templates ' ,
18+ __DIR__ . '/tests ' ,
19+ ])
20+ ->notPath ([
21+ '#(^|/)data/# ' ,
22+ '#(^|/)layouts/# ' ,
23+ '#(^|/)views/# ' ,
24+ ]);
25+
26+ return (new Config ())
27+ ->setFinder ($ finder )
28+ ->setRules ([
29+ 'phpdoc_scalar ' => true ,
30+ 'header_comment ' => [
31+ 'comment_type ' => 'PHPDoc ' ,
32+ 'header ' => $ header ,
33+ 'location ' => 'after_open ' ,
34+ ],
35+ ]);
Original file line number Diff line number Diff line change 3838 "phpstan/phpstan" : " ^2.1" ,
3939 "yiisoft/yii2-coding-standards" : " ^3.0" ,
4040 "rector/rector" : " ^2.3" ,
41- "mspirkov/yii2-rector" : " ^0.1"
41+ "mspirkov/yii2-rector" : " ^0.1" ,
42+ "slevomat/coding-standard" : " ^8.31" ,
43+ "friendsofphp/php-cs-fixer" : " ^3.95"
4244 },
4345 "repositories" : [
4446 {
6466 "bin" : [" apidoc" ],
6567 "config" : {
6668 "allow-plugins" : {
67- "yiisoft/yii2-composer" : true
69+ "yiisoft/yii2-composer" : true ,
70+ "dealerdirect/phpcodesniffer-composer-installer" : true
6871 }
6972 },
7073 "scripts" : {
71- "cs" : " ./vendor/bin/phpcs" ,
72- "cs-fix" : " ./vendor/bin/phpcbf" ,
74+ "cs" : " ./vendor/bin/phpcs && ./vendor/bin/php-cs-fixer check " ,
75+ "cs-fix" : " ./vendor/bin/phpcbf && ./vendor/bin/php-cs-fixer fix " ,
7376 "static" : " ./vendor/bin/phpstan --memory-limit=-1" ,
7477 "tests" : " ./vendor/bin/phpunit" ,
7578 "rector" : " ./vendor/bin/rector"
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ class BaseDoc extends BaseObject
4343 private const PSALM_IMPORT_TYPE_ANNOTATION_NAME = 'psalm-import-type ' ;
4444 public const INHERITDOC_TAG_NAME = 'inheritdoc ' ;
4545 private const TODO_TAG_NAME = 'todo ' ;
46+
4647 /**
4748 * @var \phpDocumentor\Reflection\Types\Context|null
4849 */
@@ -103,8 +104,6 @@ class BaseDoc extends BaseObject
103104 * @var array<string, Template>
104105 */
105106 public $ templates = [];
106-
107-
108107 /**
109108 * @var array<string, PseudoTypeDoc>
110109 */
@@ -121,6 +120,8 @@ class BaseDoc extends BaseObject
121120 * @var array<string, PseudoTypeImportDoc>
122121 */
123122 public array $ psalmTypeImports = [];
123+
124+
124125 /**
125126 * Checks if doc has tag of a given name
126127 * @param string $name tag name
Original file line number Diff line number Diff line change 22<ruleset name =" Yii2" >
33 <rule ref =" vendor/yiisoft/yii2-coding-standards/Yii2" ></rule >
44
5+ <rule ref =" SlevomatCodingStandard.Classes.TraitUseSpacing" >
6+ <properties >
7+ <property name =" linesCountBeforeFirstUseWhenFirstInClass" value =" 0" />
8+ <property name =" linesCountAfterLastUseWhenLastInClass" value =" 0" />
9+ </properties >
10+ </rule >
11+ <rule ref =" SlevomatCodingStandard.Classes.ConstantSpacing" >
12+ <properties >
13+ <property name =" minLinesCountBeforeWithComment" value =" 0" />
14+ </properties >
15+ </rule >
16+ <rule ref =" SlevomatCodingStandard.Classes.PropertySpacing" >
17+ <properties >
18+ <property name =" minLinesCountBeforeWithComment" value =" 0" />
19+ </properties >
20+ </rule >
21+ <rule ref =" SlevomatCodingStandard.Classes.MethodSpacing" >
22+ <properties >
23+ <property name =" minLinesCount" value =" 1" />
24+ <property name =" maxLinesCount" value =" 2" />
25+ </properties >
26+ </rule >
27+
528 <rule ref =" PSR1.Files.SideEffects.FoundWithSymbols" >
629 <exclude-pattern >tests/bootstrap.php</exclude-pattern >
730 </rule >
Original file line number Diff line number Diff line change 11<?php
22
3+ /**
4+ * @link https://www.yiiframework.com/
5+ * @copyright Copyright (c) 2008 Yii Software LLC
6+ * @license https://www.yiiframework.com/license/
7+ */
8+
39namespace yiiunit \apidoc ;
410
511use Exception ;
Original file line number Diff line number Diff line change 11<?php
22
3+ /**
4+ * @link https://www.yiiframework.com/
5+ * @copyright Copyright (c) 2008 Yii Software LLC
6+ * @license https://www.yiiframework.com/license/
7+ */
8+
39// ensure we get report on all possible php errors
410error_reporting (-1 );
511
You can’t perform that action at this time.
0 commit comments