Skip to content

Commit

Permalink
Apply current Magento Coding Style
Browse files Browse the repository at this point in the history
  • Loading branch information
cmuench committed Dec 28, 2019
1 parent 5525c28 commit 9291d56
Show file tree
Hide file tree
Showing 150 changed files with 1,389 additions and 903 deletions.
55 changes: 24 additions & 31 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -1,37 +1,30 @@
<?php

$finder = Symfony\CS\Finder\DefaultFinder::create()
$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests')
;

return Symfony\CS\Config::create()
->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
->fixers(
array_merge(
explode(
',',
'single_blank_line_before_namespace,no_blank_lines_after_class_opening,unused_use,ordered_use,' .
'concat_with_spaces,spaces_cast,trailing_spaces,unalign_equals'
),
array(
'array_element_no_space_before_comma', 'array_element_white_space_after_comma',
'multiline_array_trailing_comma',
'align_double_arrow',
'trim_array_spaces',
'spaces_cast',
'function_typehint_space', 'join_function',
'blankline_after_open_tag', 'duplicate_semicolon',
'extra_empty_lines', 'no_blank_lines_after_class_opening',
'operators_spaces',
'remove_leading_slash_use',
'remove_lines_between_uses',
'newline_after_open_tag',
'ordered_use',
'standardize_not_equal',
)
)
)
->finder($finder)
->setUsingCache(true)
;
return PhpCsFixer\Config::create()
->setFinder($finder)
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'concat_space' => ['spacing' => 'one'],
'include' => true,
'new_with_braces' => true,
'no_empty_statement' => true,
'no_extra_consecutive_blank_lines' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_multiline_whitespace_around_double_arrow' => true,
'no_multiline_whitespace_before_semicolons' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unused_imports' => true,
'no_whitespace_in_blank_line' => true,
'object_operator_without_whitespace' => true,
'ordered_imports' => true,
'standardize_not_equals' => true,
'ternary_operator_spaces' => true,
]);
2 changes: 1 addition & 1 deletion captainhook.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"options": []
},
{
"action": "vendor/bin/php-cs-fixer fix -q --config-file=.php_cs",
"action": "vendor/bin/php-cs-fixer fix -q --config=.php_cs",
"options": []
}
]
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"fzaninotto/faker": "~1.4",
"n98/junit-xml": "~1.0",
"psy/psysh": "~0.7",
"symfony/console": "~2.3",
"symfony/console": "~3.0",
"symfony/event-dispatcher": "~2.3",
"symfony/finder": "~2.3||~3.0",
"symfony/process": "~2.3",
Expand All @@ -37,7 +37,7 @@
"require-dev": {
"ext-xdebug": "*",
"bamarni/symfony-console-autocomplete": "^1.2.0",
"friendsofphp/php-cs-fixer": "~1.12.0",
"friendsofphp/php-cs-fixer": "~2.2.1",
"phing/phing": "~2.10.0",
"phpunit/phpunit": "~6.2.0",
"seld/phar-utils": "~1.0.1",
Expand Down
Loading

0 comments on commit 9291d56

Please sign in to comment.