Skip to content

Commit

Permalink
Adds code style checking
Browse files Browse the repository at this point in the history
  • Loading branch information
moay committed Aug 30, 2019
1 parent 98ad455 commit 8fea416
Show file tree
Hide file tree
Showing 45 changed files with 1,302 additions and 375 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@
npm-debug.log
yarn-error.log
###< symfony/webpack-encore-bundle ###

###> friendsofphp/php-cs-fixer ###
/.php_cs
/.php_cs.cache
###< friendsofphp/php-cs-fixer ###
42 changes: 42 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

return PhpCsFixer\Config::create()
->setRules([
'@Symfony' => true,
'method_argument_space' => ['ensure_fully_multiline' => true],
'array_syntax' => ['syntax' => 'short'],
'list_syntax' => ['syntax' => 'short'],
'no_null_property_initialization' => true,
'ternary_to_null_coalescing' => true,
'no_useless_else' => true,
'no_useless_return' => true,
// Risky Rules
'pow_to_exponentiation' => true,
'psr4' => true,
'random_api_migration' => true,
'self_accessor' => true,
'silenced_deprecation_error' => true,
'no_homoglyph_names' => true,
'no_alias_functions' => true,
'modernize_types_casting' => true,
'is_null' => true,
'dir_constant' => true,
'function_to_constant' => true,
])
->setRiskyAllowed(true)

->setFinder(
PhpCsFixer\Finder::create()
->in([
__DIR__.'/config',
__DIR__.'/bin',
__DIR__.'/src',
__DIR__.'/public',
__DIR__.'/tests',
])
->append([
__FILE__,
__DIR__.'/deploy.php',
])
->notPath('config.php')
);
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"ext-iconv": "*",
"ext-json": "*",
"czproject/git-php": "^3.12",
"friendsofphp/php-cs-fixer": "^2.15",
"php-http/httplug-pack": "^1.1",
"psr/simple-cache": "^1.0",
"robinvdvleuten/ulid": "^3.0",
Expand All @@ -25,6 +26,7 @@
"symfony/yaml": "^4.0"
},
"require-dev": {
"phpro/grumphp": "^0.15.2",
"symfony/browser-kit": "^4.1",
"symfony/debug-pack": "^1.0",
"symfony/phpunit-bridge": "^4.0",
Expand Down
Loading

0 comments on commit 8fea416

Please sign in to comment.