Skip to content

Commit 036c568

Browse files
authored
Merge pull request #578 from mimmi20/updates
upgrade to PHP 8.3, remove sniff, remove stubs
2 parents d003a8c + ca25a68 commit 036c568

Some content is hidden

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

49 files changed

+30
-4249
lines changed

.codeclimate.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
version: "2"
22
checks:
33
argument-count:
4-
enabled: true
4+
enabled: false
55
complex-logic:
6-
enabled: true
6+
enabled: false
77
file-lines:
88
enabled: false
99
method-complexity:
10-
enabled: true
10+
enabled: false
1111
method-count:
12-
enabled: true
12+
enabled: false
1313
method-lines:
14-
enabled: true
14+
enabled: false
1515
nested-control-flow:
1616
enabled: true
1717
return-statements:
18-
enabled: true
18+
enabled: false
1919
similar-code:
2020
enabled: false
2121
identical-code:

.github/workflows/continuous-integration.yml

+13-62
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
validate:
2020
name: "Validate Project"
2121

22-
uses: "mimmi20/ci/.github/workflows/validate.yml@8.1"
22+
uses: "mimmi20/ci/.github/workflows/validate.yml@8.3"
2323
with:
2424
extensions: "ctype, curl, iconv, mbstring, ctype, dom, intl, simplexml, tokenizer, xml, xmlwriter, pdo"
2525
ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0"
@@ -37,7 +37,7 @@ jobs:
3737

3838
needs: "validate"
3939

40-
uses: "mimmi20/ci/.github/workflows/install.yml@8.1"
40+
uses: "mimmi20/ci/.github/workflows/install.yml@8.3"
4141
with:
4242
extensions: "ctype, curl, iconv, mbstring, ctype, dom, intl, simplexml, tokenizer, xml, xmlwriter, pdo"
4343
ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0"
@@ -65,7 +65,7 @@ jobs:
6565

6666
php-version:
6767
# Should use the lowest supported version
68-
- "8.1"
68+
- "8.3"
6969

7070
steps:
7171
- name: "Checkout"
@@ -109,7 +109,7 @@ jobs:
109109

110110
runs-on: "${{ matrix.operating-system }}"
111111

112-
timeout-minutes: 10
112+
timeout-minutes: 30
113113

114114
continue-on-error: false
115115

@@ -122,7 +122,7 @@ jobs:
122122

123123
php-version:
124124
# Should use the lowest supported version
125-
- "8.1"
125+
- "8.3"
126126

127127
steps:
128128
- name: "Checkout"
@@ -153,7 +153,12 @@ jobs:
153153
composer-options: "--optimize-autoloader --prefer-dist --prefer-stable -v"
154154

155155
- name: "Run squizlabs/php_codesniffer"
156-
run: "vendor/bin/phpcs -wps --colors --standard=src/Mimmi20CodingStandard/ruleset.xml --extensions=php,stub -q --report=checkstyle src stubs .php-cs-fixer.php rector.php | cs2pr"
156+
id: "phpcs"
157+
run: "vendor/bin/phpcs -wps --colors --standard=src/Mimmi20CodingStandard/ruleset.xml --extensions=php --report-full --report-performance --report-checkstyle=./phpcs-report.xml -v src .php-cs-fixer.php rector.php"
158+
159+
- name: "Show PHPCS results in PR"
160+
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
161+
run: "cs2pr ./phpcs-report.xml"
157162

158163
static-code-analysis:
159164
name: "Static Code Analysis with PHPStan"
@@ -175,7 +180,7 @@ jobs:
175180

176181
php-version:
177182
# Should use the lowest supported version
178-
- "8.1"
183+
- "8.3"
179184

180185
steps:
181186
- name: "Checkout"
@@ -208,59 +213,6 @@ jobs:
208213
- name: "Run phpstan/phpstan"
209214
run: "vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=768M --no-progress"
210215

211-
phpmd:
212-
name: "Check Rules with PHPMD"
213-
214-
needs: "install"
215-
216-
runs-on: "${{ matrix.operating-system }}"
217-
218-
timeout-minutes: 10
219-
220-
continue-on-error: false
221-
222-
strategy:
223-
fail-fast: false
224-
225-
matrix:
226-
operating-system:
227-
- "ubuntu-24.04"
228-
229-
php-version:
230-
# Should use the lowest supported version
231-
- "8.1"
232-
233-
steps:
234-
- name: "Checkout"
235-
uses: "actions/checkout@v4"
236-
with:
237-
# Disabling shallow clone is recommended for improving relevancy of reporting
238-
fetch-depth: 0
239-
lfs: false
240-
persist-credentials: false
241-
242-
- name: "Install PHP"
243-
uses: "shivammathur/[email protected]"
244-
with:
245-
php-version: "${{ matrix.php-version }}"
246-
extensions: "json, opcache"
247-
ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0"
248-
coverage: "none"
249-
tools: "composer:v2, phpmd"
250-
env:
251-
fail-fast: true
252-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
253-
phpts: "nts"
254-
255-
- name: "Update dependencies with composer"
256-
uses: "ramsey/[email protected]"
257-
with:
258-
dependency-versions: "lowest"
259-
composer-options: "${{ inputs.composer-options }}"
260-
261-
- name: "Run phpmd/phpmd"
262-
run: "phpmd src github phpmd.ruleset.xml"
263-
264216
rector:
265217
name: "Checks with Rector"
266218

@@ -281,7 +233,7 @@ jobs:
281233

282234
php-version:
283235
# Should use the lowest supported version
284-
- "8.1"
236+
- "8.3"
285237

286238
steps:
287239
- name: "Checkout"
@@ -331,7 +283,6 @@ jobs:
331283
- "php-cs-fixer"
332284
- "phpcs"
333285
- "static-code-analysis"
334-
- "phpmd"
335286
- "rector"
336287

337288
steps:

.php-cs-fixer.php

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
->files()
2727
->name('*.php')
2828
->in(__DIR__ . '/src')
29-
->in(__DIR__ . '/stubs')
3029
->append([__DIR__ . '/rector.php'])
3130
->append([__FILE__]);
3231

composer.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@
3131
"source": "https://github.com/mimmi20/coding-standard"
3232
},
3333
"require": {
34-
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
34+
"php": "~8.3.0 || ~8.4.0 || ~8.5.0",
3535
"dealerdirect/phpcodesniffer-composer-installer": "^1.0.0",
3636
"friendsofphp/php-cs-fixer": "^3.65.0",
37-
"sirbrillig/phpcs-variable-analysis": "^2.11.21",
3837
"slevomat/coding-standard": "^8.15.0",
3938
"squizlabs/php_codesniffer": "^3.11.1"
4039
},
@@ -44,7 +43,7 @@
4443
"phpstan/phpstan-deprecation-rules": "^1.2.1",
4544
"rector/rector": "^1.2.10",
4645
"rector/type-perfect": "^1.0.0",
47-
"symfony/process": "^6.4.15",
46+
"symfony/process": "^7.2.0",
4847
"symplify/phpstan-rules": "^13.0.1",
4948
"tomasvotruba/cognitive-complexity": "^0.2.3",
5049
"tomasvotruba/type-coverage": "^1.0.0",

phpcs-report.xml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<checkstyle version="3.11.1">
3+
</checkstyle>
4+

phpmd.ruleset.xml

-36
This file was deleted.

phpstan.neon

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
parameters:
22
level: max
33

4-
phpVersion: 80100 # PHP 8.1
4+
phpVersion: 80300 # PHP 8.3
55

66
parallel:
77
maximumNumberOfProcesses: 1
88
processTimeout: 200.0
99

1010
paths:
1111
- src
12-
- stubs
1312

1413
bootstrapFiles:
1514
- %currentWorkingDirectory%/vendor/autoload.php

rector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
$rectorConfig->sets([
3030
SetList::DEAD_CODE,
31-
LevelSetList::UP_TO_PHP_81,
31+
LevelSetList::UP_TO_PHP_83,
3232
PHPUnitSetList::PHPUNIT_100,
3333
]);
3434

src/Mimmi20CodingStandard/Sniffs/Commenting/FunctionCommentThrowTagSniff.php

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace Mimmi20CodingStandard\Sniffs\Commenting;
1515

16+
use Override;
1617
use PHP_CodeSniffer\Exceptions\RuntimeException;
1718
use PHP_CodeSniffer\Files\File;
1819
use PHP_CodeSniffer\Sniffs\Sniff;
@@ -60,6 +61,7 @@ final class FunctionCommentThrowTagSniff implements Sniff
6061
*
6162
* @throws void
6263
*/
64+
#[Override]
6365
public function register(): array
6466
{
6567
return [T_FUNCTION];
@@ -76,6 +78,7 @@ public function register(): array
7678
*
7779
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
7880
*/
81+
#[Override]
7982
public function process(File $phpcsFile, $stackPtr): void
8083
{
8184
$tokens = $phpcsFile->getTokens();

src/Mimmi20CodingStandard/ruleset.xml

-9
Original file line numberDiff line numberDiff line change
@@ -1117,13 +1117,4 @@
11171117

11181118
<!-- Force rules for function phpDoc -->
11191119
<rule ref="Mimmi20CodingStandard.Commenting.FunctionCommentThrowTag"/>
1120-
1121-
<rule ref="VariableAnalysis.CodeAnalysis.VariableAnalysis">
1122-
<properties>
1123-
<!-- checked by SlevomatCodingStandard.Functions.UnusedParameter -->
1124-
<property name="allowUnusedFunctionParameters" value="true"/>
1125-
<!-- checked by SlevomatCodingStandard.Variables.UnusedVariable -->
1126-
<property name="allowUnusedVariablesInFileScope" value="true"/>
1127-
</properties>
1128-
</rule>
11291120
</ruleset>

0 commit comments

Comments
 (0)