Skip to content

Commit

Permalink
[TASK] styleguide: Bump friendsofphp/php-cs-fixer:3.37.1
Browse files Browse the repository at this point in the history
#453

* Align rules with core
* php-cs-fixer 3.37.1 and don't allow updates to
  be in line with core

> composer req --dev friendsofphp/php-cs-fixer:3.37.1
> Build/Scripts/runTests.sh -s cgl
  • Loading branch information
lolli42 authored Oct 30, 2023
1 parent cce6be9 commit d0d87d6
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
24 changes: 14 additions & 10 deletions Build/php-cs-fixer/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,33 @@
->setRiskyAllowed(true)
->setRules([
'@DoctrineAnnotation' => true,
'@PER' => true,
// @todo: Switch to @PER-CS2.0 once php-cs-fixer's todo list is done: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/7247
'@PER-CS1.0' => true,
'array_syntax' => ['syntax' => 'short'],
'blank_line_after_opening_tag' => true,
'cast_spaces' => ['space' => 'none'],
'compact_nullable_typehint' => true,
// @todo: Can be dropped once we enable @PER-CS2.0
'concat_space' => ['spacing' => 'one'],
'declare_equal_normalize' => ['space' => 'none'],
'declare_parentheses' => true,
'dir_constant' => true,
// @todo: Can be dropped once we enable @PER-CS2.0
'function_declaration' => [
'closure_fn_spacing' => 'none',
],
'function_to_constant' => ['functions' => ['get_called_class', 'get_class', 'get_class_this', 'php_sapi_name', 'phpversion', 'pi']],
'type_declaration_spaces' => true,
'lowercase_cast' => true,
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
'global_namespace_import' => ['import_classes' => false, 'import_constants' => false, 'import_functions' => false],
'list_syntax' => ['syntax' => 'short'],
// @todo: Can be dropped once we enable @PER-CS2.0
'method_argument_space' => true,
'modernize_strpos' => true,
'modernize_types_casting' => true,
'native_function_casing' => true,
'new_with_braces' => true,
'no_alias_functions' => true,
'no_blank_lines_after_phpdoc' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_null_property_initialization' => true,
'no_short_bool_cast' => true,
Expand All @@ -52,8 +56,7 @@
'no_unused_imports' => true,
'no_useless_else' => true,
'no_useless_nullsafe_operator' => true,
'no_whitespace_in_blank_line' => true,
'ordered_imports' => true,
'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'],
'php_unit_construct' => ['assertions' => ['assertEquals', 'assertSame', 'assertNotEquals', 'assertNotSame']],
'php_unit_mock_short_will_return' => true,
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
Expand All @@ -68,7 +71,8 @@
'single_quote' => true,
'single_space_around_construct' => true,
'single_line_comment_style' => ['comment_types' => ['hash']],
'single_trait_insert_per_statement' => true,
// @todo: Can be dropped once we enable @PER-CS2.0
'single_line_empty_body' => true,
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
'whitespace_after_comma_in_array' => ['ensure_single_space' => true],
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
Expand Down
2 changes: 1 addition & 1 deletion Classes/TcaDataGenerator/FieldGenerator/TypeFlex.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function generate(array $data): string
if (!isset($containerElementArray['el']) || !is_array($containerElementArray['el'])) {
continue;
}
$containerCounter ++;
$containerCounter++;
foreach ($containerElementArray['el'] as $containerSingleElementName => $containerSingleElementArray) {
$aFlexFieldData['fieldName'] = $containerSingleElementName;
$aFlexFieldData['fieldConfig'] = $containerSingleElementArray;
Expand Down
2 changes: 1 addition & 1 deletion Classes/TcaDataGenerator/TableHandler/InlineMn.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function handle(string $tableName): void
$numberOfChildRelationsToCreate = 2;
$numberOfChildRows = 4;
$connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
for ($i = 0; $i < $numberOfChildRows; $i ++) {
for ($i = 0; $i < $numberOfChildRows; $i++) {
$fieldValues = [
'pid' => $pidOfMainTable,
'tstamp' => $context->getAspect('date')->get('timestamp'),
Expand Down
2 changes: 1 addition & 1 deletion Classes/TcaDataGenerator/TableHandler/InlineMnGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function handle(string $tableName): void
$numberOfChildRelationsToCreate = 2;
$numberOfChildRows = 4;
$connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
for ($i = 0; $i < $numberOfChildRows; $i ++) {
for ($i = 0; $i < $numberOfChildRows; $i++) {
$fieldValues = [
'pid' => $pidOfMainTable,
'tstamp' => $context->getAspect('date')->get('timestamp'),
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"codeception/module-asserts": "^3.0",
"codeception/module-cli": "^2.0",
"codeception/module-webdriver": "^4.0",
"friendsofphp/php-cs-fixer": "^3.27",
"friendsofphp/php-cs-fixer": "3.37.1",
"phpstan/phpstan": "^1.10.14",
"typo3/cms-core": "~13.0@dev",
"typo3/cms-frontend": "~13.0@dev",
Expand Down

0 comments on commit d0d87d6

Please sign in to comment.