Skip to content

Commit 78c8b8d

Browse files
committed
Upgrade PHPCS
1 parent b2ec996 commit 78c8b8d

File tree

4 files changed

+614
-379
lines changed

4 files changed

+614
-379
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ docker-compose.yml
2323
# for image related files
2424
misc
2525
.phpstorm.meta.php
26+
.php_cs.cache

.php_cs

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,40 @@
11
<?php
22

3-
require_once __DIR__ . '/vendor/sllh/php-cs-fixer-styleci-bridge/autoload.php';
3+
$finder = PhpCsFixer\Finder::create()
4+
->in([
5+
'app',
6+
'bootstrap',
7+
'config',
8+
'database',
9+
'resources/lang',
10+
'routes',
11+
'tests',
12+
]);
413

5-
use SLLH\StyleCIBridge\ConfigBridge;
6-
7-
return ConfigBridge::create();
14+
return PhpCsFixer\Config::create()
15+
->setRules([
16+
'@Symfony' => true,
17+
'@PSR1' => true,
18+
'@PSR2' => true,
19+
'align_multiline_comment' => ['comment_type' => 'phpdocs_like'],
20+
'array_syntax' => ['syntax' => 'short'],
21+
'blank_line_before_return' => true,
22+
'blank_line_before_statement' => false,
23+
'combine_consecutive_unsets' => true,
24+
'concat_space' => ['spacing' => 'one'],
25+
'declare_equal_normalize' => ['space' => 'single'],
26+
'heredoc_to_nowdoc' => true,
27+
'linebreak_after_opening_tag' => true,
28+
'new_with_braces' => false,
29+
'no_alias_functions' => true,
30+
'no_multiline_whitespace_before_semicolons' => true,
31+
'no_unreachable_default_argument_value' => true,
32+
'no_useless_return' => true,
33+
'not_operator_with_successor_space' => true,
34+
'phpdoc_separation' => false,
35+
'protected_to_private' => false,
36+
'psr0' => ['dir' => 'app'],
37+
'psr4' => true,
38+
'random_api_migration' => true,
39+
'standardize_not_equals' => true,
40+
])->setRiskyAllowed(true)->setFinder($finder);

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"doctrine/dbal": "2.5.13",
2222
"edvinaskrucas/settings": "2.0.0",
2323
"fideloper/proxy": "3.3.3",
24+
"friendsofphp/php-cs-fixer": "2.4.0",
2425
"guzzlehttp/guzzle": "6.2.3",
2526
"igaster/laravel-theme": "1.16.0",
2627
"laracasts/utilities": "2.1.0",
@@ -43,12 +44,10 @@
4344
},
4445
"require-dev": {
4546
"barryvdh/laravel-ide-helper": "2.4.1",
46-
"friendsofphp/php-cs-fixer": "1.13.1",
4747
"fzaninotto/faker": "1.6.0",
4848
"mockery/mockery": "0.9.9",
4949
"php-mock/php-mock-phpunit": "1.1.2",
50-
"phpunit/phpunit": "5.7.21",
51-
"sllh/php-cs-fixer-styleci-bridge": "2.1.1"
50+
"phpunit/phpunit": "5.7.21"
5251
},
5352
"autoload": {
5453
"classmap": [

0 commit comments

Comments
 (0)