Skip to content

Commit ba3e492

Browse files
authored
chore: upgrade SCA, run PHP CS Fixer (#385)
1 parent dbd2a85 commit ba3e492

37 files changed

Lines changed: 1319 additions & 800 deletions

.github/workflows/static-code-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Setup PHP
1515
uses: shivammathur/setup-php@v2
1616
with:
17-
php-version: 8.1
17+
php-version: 8.3
1818
coverage: none
1919

2020
- name: Validate composer.json

.php-cs-fixer.dist.php

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,28 @@
11
<?php
22

3-
$finder = PhpCsFixer\Finder::create()
3+
use PhpCsFixer\Config;
4+
use PhpCsFixer\Finder;
5+
6+
$finder = Finder::create()
47
->ignoreDotFiles(false)
58
->ignoreVCSIgnored(true)
69
->exclude('tests/Fixture')
710
->in(__DIR__)
811
;
912

10-
$config = new PhpCsFixer\Config();
13+
$config = new Config();
1114
$config
1215
->setRiskyAllowed(true)
1316
->setRules([
1417
'@PhpCsFixer' => true,
1518
'@PhpCsFixer:risky' => true,
1619
'@PHP70Migration' => true,
17-
'yoda_style' => [
18-
'equal' => false,
19-
'identical' => false,
20-
'less_and_greater' => false,
21-
],
22-
'concat_space' => ['spacing' => 'one'],
23-
'explicit_indirect_variable' => false,
24-
'explicit_string_variable' => false,
25-
'method_chaining_indentation' => false,
26-
'php_unit_test_annotation' => false,
27-
'single_line_comment_style' => false,
28-
'ternary_to_elvis_operator' => false,
29-
'visibility_required' => ['elements' => ['method', 'property']],
20+
'method_chaining_indentation' => false, // does not fit style of codebase
21+
'php_unit_test_annotation' => false, // does not fit style of codebase
22+
'php_unit_data_provider_return_type' => false, // for low-level PHP support
23+
'ternary_to_elvis_operator' => false, // for low-level PHP support
24+
'visibility_required' => ['elements' => ['method', 'property']], // for low-level PHP support
25+
'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => false], // to support low-end PHP versions
3026
])
3127
->setFinder($finder)
3228
;

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"cd dev-tools && composer install --no-interaction"
6767
],
6868
"sca": [
69-
"php dev-tools/vendor/bin/php-cs-fixer fix --dry-run -vv",
69+
"php dev-tools/vendor/bin/php-cs-fixer check -vv",
7070
"php dev-tools/vendor/bin/phpmd src text build/config/phpmd.xml"
7171
]
7272
},

dev-tools/composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"php": "^8.1",
3+
"php": "^8.3",
44
"ext-json": "*",
55
"ext-simplexml": "*"
66
},
@@ -14,6 +14,10 @@
1414
},
1515
"config": {
1616
"optimize-autoloader": true,
17+
"platform": {
18+
"php": "8.3"
19+
},
20+
"prefer-stable": true,
1721
"sort-packages": true
1822
}
1923
}

0 commit comments

Comments
 (0)