File tree 5 files changed +23
-81
lines changed
5 files changed +23
-81
lines changed Original file line number Diff line number Diff line change 6
6
# For the full copyright and license information, please view the LICENSE
7
7
# file that was distributed with this source code.
8
8
9
+ /.php_cs.cache
9
10
/composer.lock
10
11
/vendor
Original file line number Diff line number Diff line change 33
33
},
34
34
"require-dev" : {
35
35
"doctrine/orm" : " ^2.5" ,
36
- "friendsofphp /php-cs-fixer" : " ^1.12 " ,
36
+ "kreta /php-cs-fixer-config " : " ^1.0 " ,
37
37
"phpspec/phpspec" : " ^3.2"
38
38
},
39
39
"scripts" : {
40
40
"cs" : [
41
- " php-cs-fixer fix --config-file =etc/phpcs/.php_cs" ,
42
- " php-cs-fixer fix --config-file =etc/phpcs/.phpspec_cs"
41
+ " php-cs-fixer fix --config=etc/phpcs/.php_cs -v " ,
42
+ " php-cs-fixer fix --config=etc/phpcs/.phpspec_cs -v "
43
43
]
44
44
},
45
45
"autoload" : {
46
46
"psr-4" : {
47
47
"Kreta\\ SharedKernel\\ " : " src/Kreta/SharedKernel/" ,
48
48
"Kreta\\ SharedKernel\\ Tests\\ " : " tests/"
49
49
},
50
- "files" : [
51
- " etc/phpcs/common.php"
52
- ],
53
50
"exclude-from-classmap" : [
54
51
" tests/"
55
52
]
Original file line number Diff line number Diff line change 10
10
* file that was distributed with this source code.
11
11
*/
12
12
13
- use Kreta \ SharedKernel \ CS ;
13
+ declare (strict_types= 1 ) ;
14
14
15
- CS \setHeader () ;
15
+ use Kreta \ PhpCsFixerConfig \ KretaConfig ;
16
16
17
- $ finder = Symfony \CS \Finder::create ()
18
- ->notName ('*Spec.php ' )
19
- ->name ('*.php ' )
20
- ->in ([
21
- __DIR__ . '/../../src ' ,
22
- __DIR__ . '/../../tests/Double ' ,
23
- __DIR__ . '/../../tests/Matchers '
24
- ]);
17
+ $ config = new KretaConfig ();
18
+ $ config ->getFinder ()->in (__DIR__ . '/src ' );
25
19
26
- return Symfony \CS \Config::create ()
27
- ->level (Symfony \CS \FixerInterface::SYMFONY_LEVEL )
28
- ->finder ($ finder )
29
- ->fixers (CS \fixers ());
20
+ $ cacheDir = getenv ('TRAVIS ' ) ? getenv ('HOME ' ) . '/.php-cs-fixer ' : __DIR__ ;
21
+
22
+ $ config ->setCacheFile ($ cacheDir . '/.php_cs.cache ' );
23
+
24
+ return $ config ;
Original file line number Diff line number Diff line change 10
10
* file that was distributed with this source code.
11
11
*/
12
12
13
- use Kreta\SharedKernel\CS ;
13
+ declare(strict_types=1) ;
14
14
15
- CS\setHeader() ;
15
+ use Kreta\PhpCsFixerConfig\KretaConfig ;
16
16
17
- $finder = Symfony\CS\Finder::create()
18
- ->in([
19
- __DIR__ . '/../../tests/Spec',
20
- ])
17
+ $config = new KretaConfig(true);
18
+ $config->getFinder()
19
+ ->in(__DIR__ . '/tests/Spec')
21
20
->name('*Spec.php');
22
21
23
- return Symfony\CS\Config::create()
24
- ->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
25
- ->finder($finder)
26
- ->fixers(array_merge(CS\fixers(), ['-visibility']));
22
+ $cacheDir = getenv('TRAVIS') ? getenv('HOME') . '/.php-cs-fixer' : __DIR__;
23
+
24
+ $config->setCacheFile($cacheDir . '/.php_cs.cache');
25
+
26
+ return $config;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments