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 11<?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;
211
312use plumthedev \PhpCsFixer \Config ;
413
514$ csConfig = Config::create ();
6- $ csConfigFinder = $ csConfig ->getFinder ();
715
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
928$ csConfig ->setFinder ($ csConfigFinder );
1029
1130return $ csConfig ;
Original file line number Diff line number Diff line change 11<?php
22/**
3- * Yii2 PHP CS Fixer Config - Finder.
3+ * Yii2 PHP CS Fixer Config
44 *
55 * @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
710 */
811
912namespace plumthedev \PhpCsFixer ;
Original file line number Diff line number Diff line change 11<?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+ */
211
312namespace plumthedev \PhpCsFixer \tests ;
413
@@ -43,4 +52,13 @@ public function testHasValidName()
4352 {
4453 $ this ->assertEquals ('yii2-php-cs-fixer-config ' , $ this ->csFixerConfig ->getName ());
4554 }
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+ }
4664}
Original file line number Diff line number Diff line change 11<?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+ */
211
312namespace plumthedev \PhpCsFixer \tests ;
413
You can’t perform that action at this time.
0 commit comments