File tree Expand file tree Collapse file tree 4 files changed +53
-4
lines changed Expand file tree Collapse file tree 4 files changed +53
-4
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
+ $ projectHeader = <<<'HEADER'
3
+ Yii2 PHP CS Fixer Config
4
+
5
+ @author Kacper Pruszynski (plumthedev)
6
+ @link https://github.com/plumthedev/yii2-php-cs-fixer-config
7
+ @copyright Copyright (c) 2019 plumthedev
8
+ @license https://github.com/plumthedev/yii2-php-cs-fixer-config/blob/master/LICENSE
9
+ @version 1.0.1
10
+ HEADER;
2
11
3
12
use plumthedev \PhpCsFixer \Config ;
4
13
5
14
$ csConfig = Config::create ();
6
- $ csConfigFinder = $ csConfig ->getFinder ();
7
15
8
- $ csConfigFinder ->in (__DIR__ );
16
+ // CS Config setup
17
+ $ csConfig ->mergeRules ([
18
+ 'header_comment ' => [
19
+ 'header ' => $ projectHeader ,
20
+ 'commentType ' => 'PHPDoc ' ,
21
+ 'separate ' => 'bottom ' ,
22
+ ]
23
+ ]);
24
+
25
+ // CS Finder setup
26
+ $ csConfigFinder = $ csConfig ->getFinder ();
27
+ $ csConfigFinder ->in (__DIR__ ); // set current project directory
9
28
$ csConfig ->setFinder ($ csConfigFinder );
10
29
11
30
return $ csConfig ;
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * Yii2 PHP CS Fixer Config - Finder.
3
+ * Yii2 PHP CS Fixer Config
4
4
*
5
5
* @author Kacper Pruszynski (plumthedev)
6
- * @version 1.0.0
6
+ * @link https://github.com/plumthedev/yii2-php-cs-fixer-config
7
+ * @copyright Copyright (c) 2019 plumthedev
8
+ * @license https://github.com/plumthedev/yii2-php-cs-fixer-config/blob/master/LICENSE
9
+ * @version 1.0.1
7
10
*/
8
11
9
12
namespace plumthedev \PhpCsFixer ;
Original file line number Diff line number Diff line change 1
1
<?php
2
+ /**
3
+ * Yii2 PHP CS Fixer Config
4
+ *
5
+ * @author Kacper Pruszynski (plumthedev)
6
+ * @link https://github.com/plumthedev/yii2-php-cs-fixer-config
7
+ * @copyright Copyright (c) 2019 plumthedev
8
+ * @license https://github.com/plumthedev/yii2-php-cs-fixer-config/blob/master/LICENSE
9
+ * @version 1.0.1
10
+ */
2
11
3
12
namespace plumthedev \PhpCsFixer \tests ;
4
13
@@ -43,4 +52,13 @@ public function testHasValidName()
43
52
{
44
53
$ this ->assertEquals ('yii2-php-cs-fixer-config ' , $ this ->csFixerConfig ->getName ());
45
54
}
55
+
56
+ public function testMergeSuccessfully ()
57
+ {
58
+ $ this ->csFixerConfig ->mergeRules ([
59
+ 'mergedSuccessfully ' => true ,
60
+ ]);
61
+ $ csFixerConfigRules = $ this ->csFixerConfig ->getRules ();
62
+ $ this ->assertTrue ($ csFixerConfigRules ['mergedSuccessfully ' ]);
63
+ }
46
64
}
Original file line number Diff line number Diff line change 1
1
<?php
2
+ /**
3
+ * Yii2 PHP CS Fixer Config
4
+ *
5
+ * @author Kacper Pruszynski (plumthedev)
6
+ * @link https://github.com/plumthedev/yii2-php-cs-fixer-config
7
+ * @copyright Copyright (c) 2019 plumthedev
8
+ * @license https://github.com/plumthedev/yii2-php-cs-fixer-config/blob/master/LICENSE
9
+ * @version 1.0.1
10
+ */
2
11
3
12
namespace plumthedev \PhpCsFixer \tests ;
4
13
You can’t perform that action at this time.
0 commit comments