Skip to content

Commit 8fea416

Browse files
committed
Adds code style checking
1 parent 98ad455 commit 8fea416

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1302
-375
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,8 @@
2222
npm-debug.log
2323
yarn-error.log
2424
###< symfony/webpack-encore-bundle ###
25+
26+
###> friendsofphp/php-cs-fixer ###
27+
/.php_cs
28+
/.php_cs.cache
29+
###< friendsofphp/php-cs-fixer ###

.php_cs.dist

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
return PhpCsFixer\Config::create()
4+
->setRules([
5+
'@Symfony' => true,
6+
'method_argument_space' => ['ensure_fully_multiline' => true],
7+
'array_syntax' => ['syntax' => 'short'],
8+
'list_syntax' => ['syntax' => 'short'],
9+
'no_null_property_initialization' => true,
10+
'ternary_to_null_coalescing' => true,
11+
'no_useless_else' => true,
12+
'no_useless_return' => true,
13+
// Risky Rules
14+
'pow_to_exponentiation' => true,
15+
'psr4' => true,
16+
'random_api_migration' => true,
17+
'self_accessor' => true,
18+
'silenced_deprecation_error' => true,
19+
'no_homoglyph_names' => true,
20+
'no_alias_functions' => true,
21+
'modernize_types_casting' => true,
22+
'is_null' => true,
23+
'dir_constant' => true,
24+
'function_to_constant' => true,
25+
])
26+
->setRiskyAllowed(true)
27+
28+
->setFinder(
29+
PhpCsFixer\Finder::create()
30+
->in([
31+
__DIR__.'/config',
32+
__DIR__.'/bin',
33+
__DIR__.'/src',
34+
__DIR__.'/public',
35+
__DIR__.'/tests',
36+
])
37+
->append([
38+
__FILE__,
39+
__DIR__.'/deploy.php',
40+
])
41+
->notPath('config.php')
42+
);

composer.json

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"ext-iconv": "*",
77
"ext-json": "*",
88
"czproject/git-php": "^3.12",
9+
"friendsofphp/php-cs-fixer": "^2.15",
910
"php-http/httplug-pack": "^1.1",
1011
"psr/simple-cache": "^1.0",
1112
"robinvdvleuten/ulid": "^3.0",
@@ -25,6 +26,7 @@
2526
"symfony/yaml": "^4.0"
2627
},
2728
"require-dev": {
29+
"phpro/grumphp": "^0.15.2",
2830
"symfony/browser-kit": "^4.1",
2931
"symfony/debug-pack": "^1.0",
3032
"symfony/phpunit-bridge": "^4.0",

0 commit comments

Comments
 (0)