Skip to content

Commit 4318c3c

Browse files
committed
bump to PHP 84
1 parent 3de4554 commit 4318c3c

33 files changed

Lines changed: 86 additions & 164 deletions

.github/workflows/code_analysis.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
# see https://github.com/shivammathur/setup-php
5050
- uses: shivammathur/setup-php@v2
5151
with:
52-
php-version: 8.2
52+
php-version: 8.4
5353
coverage: none
5454

5555
# composer install cache - https://github.com/ramsey/composer-install

composer.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
"description": "Set of Symplify rules for PHP_CodeSniffer and PHP CS Fixer.",
44
"license": "MIT",
55
"require": {
6-
"php": ">=8.2",
7-
"nette/utils": "^4.0",
8-
"friendsofphp/php-cs-fixer": "^3.89"
6+
"php": ">=8.4",
7+
"nette/utils": "^4.1",
8+
"friendsofphp/php-cs-fixer": "^3.95.4"
99
},
1010
"require-dev": {
11-
"symplify/easy-coding-standard": "^12.6",
11+
"symplify/easy-coding-standard": "^13.1",
1212
"squizlabs/php_codesniffer": "^4.0",
13-
"phpunit/phpunit": "^11.5|^12.0",
13+
"phpunit/phpunit": "^12.5",
1414
"phpstan/extension-installer": "^1.4",
15-
"phpstan/phpstan": "^2.1",
16-
"rector/rector": "^2.2",
15+
"phpstan/phpstan": "^2.2",
16+
"rector/rector": "^2.4",
1717
"symplify/phpstan-extensions": "^12.0",
18-
"tomasvotruba/class-leak": "^2.0",
19-
"rector/jack": "^0.2",
20-
"tracy/tracy": "^2.11"
18+
"tomasvotruba/class-leak": "^2.1.5",
19+
"rector/jack": "^1.0",
20+
"tracy/tracy": "^2.12"
2121
},
2222
"autoload": {
2323
"psr-4": {

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ parameters:
2424

2525
# conditional check to allow various php versions
2626
-
27-
message: '#Comparison operation ">\=" between int<80200, 80599> and (.*?) is always true#'
27+
message: '#Comparison operation ">\=" between int<\d+, \d+> and (.*?) is always true#'
2828
path: src/TokenAnalyzer/DocblockRelatedParamNamesResolver.php
2929

3030
# array filter issue

src/DocBlock/UselessDocBlockCleaner.php

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ final class UselessDocBlockCleaner
1212
/**
1313
* @var string[]
1414
*/
15-
private const CLEANING_REGEXES = [
15+
private const array CLEANING_REGEXES = [
1616
self::TODO_COMMENT_BY_PHPSTORM_REGEX,
1717
self::TODO_IMPLEMENT_METHOD_COMMENT_BY_PHPSTORM_REGEX,
1818
self::COMMENT_CONSTRUCTOR_CLASS_REGEX,
@@ -28,49 +28,37 @@ final class UselessDocBlockCleaner
2828

2929
/**
3030
* @see https://regex101.com/r/5fQJkz/2
31-
* @var string
3231
*/
33-
private const TODO_IMPLEMENT_METHOD_COMMENT_BY_PHPSTORM_REGEX = '#\/\/ TODO: Implement .*\(\) method.$#';
32+
private const string TODO_IMPLEMENT_METHOD_COMMENT_BY_PHPSTORM_REGEX = '#\/\/ TODO: Implement .*\(\) method.$#';
3433

3534
/**
3635
* @see https://regex101.com/r/zayQpv/1
37-
* @var string
3836
*/
39-
private const TODO_COMMENT_BY_PHPSTORM_REGEX = '#\/\/ TODO: Change the autogenerated stub$#';
37+
private const string TODO_COMMENT_BY_PHPSTORM_REGEX = '#\/\/ TODO: Change the autogenerated stub$#';
4038

4139
/**
4240
* @see https://regex101.com/r/RzTdFH/4
43-
* @var string
4441
*/
45-
private const STANDALONE_DOCBLOCK_CLASS_REGEX = '#(\/\*\*\s+)\*\s+[cC]lass\s+[^\s]*(\s+\*\/)$#';
42+
private const string STANDALONE_DOCBLOCK_CLASS_REGEX = '#(\/\*\*\s+)\*\s+[cC]lass\s+[^\s]*(\s+\*\/)$#';
4643

4744
/**
4845
* @see https://regex101.com/r/RzTdFH/4
49-
* @var string
5046
*/
51-
private const STANDALONE_COMMENT_CLASS_REGEX = '#\/\/\s+(class|trait|interface)\s+\w+$#i';
47+
private const string STANDALONE_COMMENT_CLASS_REGEX = '#\/\/\s+(class|trait|interface)\s+\w+$#i';
5248

5349
/**
5450
* @see https://regex101.com/r/RzTdFH/4
55-
* @var string
5651
*/
57-
private const INLINE_COMMENT_CLASS_REGEX = '#\s\*\s(class|trait|interface)\s+(\w)+$#i';
52+
private const string INLINE_COMMENT_CLASS_REGEX = '#\s\*\s(class|trait|interface)\s+(\w)+$#i';
5853

59-
/**
60-
* @var string
61-
*/
62-
private const COMMENT_CONSTRUCTOR_CLASS_REGEX = '#^(\/\/|(\s|\*)+)(\s\w+\s)?constructor(\.)?$#i';
54+
private const string COMMENT_CONSTRUCTOR_CLASS_REGEX = '#^(\/\/|(\s|\*)+)(\s\w+\s)?constructor(\.)?$#i';
6355

6456
/**
6557
* @see https://regex101.com/r/1kcgR5/1
66-
* @var string
6758
*/
68-
private const DOCTRINE_GENERATED_COMMENT_REGEX = '#^(\/\*{2}\s+?)?(\*|\/\/)\s+This class was generated by the Doctrine ORM\. Add your own custom\r?\n\s+\*\s+repository methods below\.(\s+\*\/)$#';
59+
private const string DOCTRINE_GENERATED_COMMENT_REGEX = '#^(\/\*{2}\s+?)?(\*|\/\/)\s+This class was generated by the Doctrine ORM\. Add your own custom\r?\n\s+\*\s+repository methods below\.(\s+\*\/)$#';
6960

70-
/**
71-
* @var string
72-
*/
73-
private const CLASS_REPRESENTING_REGEX = '#\s\*\sClass\s+representing\s+([\w]+)$#i';
61+
private const string CLASS_REPRESENTING_REGEX = '#\s\*\sClass\s+representing\s+([\w]+)$#i';
7462

7563
public function clearDocTokenContent(Token $currentToken, ?string $classLikeName): string
7664
{

src/Enum/BlockBorderType.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,7 @@
66

77
final class BlockBorderType
88
{
9-
/**
10-
* @var string
11-
*/
12-
public const OPENER = 'opener';
9+
public const string OPENER = 'opener';
1310

14-
/**
15-
* @var string
16-
*/
17-
public const CLOSER = 'closer';
11+
public const string CLOSER = 'closer';
1812
}

src/Fixer/Annotation/RemoveMethodNameDuplicateDescriptionFixer.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
*/
2020
final class RemoveMethodNameDuplicateDescriptionFixer extends AbstractSymplifyFixer
2121
{
22-
/**
23-
* @var string
24-
*/
25-
private const ERROR_MESSAGE = 'Remove docblock descriptions which duplicate their method name';
22+
private const string ERROR_MESSAGE = 'Remove docblock descriptions which duplicate their method name';
2623

2724
private readonly MethodNameResolver $methodNameResolver;
2825

src/Fixer/Annotation/RemovePHPStormAnnotationFixer.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,10 @@ final class RemovePHPStormAnnotationFixer extends AbstractSymplifyFixer
2020
{
2121
/**
2222
* @see https://regex101.com/r/nGZBzj/2
23-
* @var string
2423
*/
25-
private const CREATED_BY_PHPSTORM_DOC_REGEX = '#\/\*\*\s+\*\s+Created by PHPStorm(.*?)\*\/#msi';
24+
private const string CREATED_BY_PHPSTORM_DOC_REGEX = '#\/\*\*\s+\*\s+Created by PHPStorm(.*?)\*\/#msi';
2625

27-
/**
28-
* @var string
29-
*/
30-
private const ERROR_MESSAGE = 'Remove "Created by PhpStorm" annotations';
26+
private const string ERROR_MESSAGE = 'Remove "Created by PhpStorm" annotations';
3127

3228
public function __construct(
3329
private readonly TokenReverser $tokenReverser

src/Fixer/Annotation/RemovePropertyVariableNameDescriptionFixer.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,12 @@
1919
*/
2020
final class RemovePropertyVariableNameDescriptionFixer extends AbstractSymplifyFixer
2121
{
22-
/**
23-
* @var string
24-
*/
25-
private const ERROR_MESSAGE = 'Remove useless "$variable" from @var tag';
22+
private const string ERROR_MESSAGE = 'Remove useless "$variable" from @var tag';
2623

2724
/**
28-
* @var string
2925
* @see https://regex101.com/r/2PxeKF/1
3026
*/
31-
private const VAR_REGEX = '#@(?:psalm-|phpstan-)?var#';
27+
private const string VAR_REGEX = '#@(?:psalm-|phpstan-)?var#';
3228

3329
private readonly PropertyNameResolver $propertyNameResolver;
3430

src/Fixer/ArrayNotation/ArrayListItemNewlineFixer.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Symplify\CodingStandard\Fixer\ArrayNotation;
66

7+
use Override;
78
use PhpCsFixer\FixerDefinition\FixerDefinition;
89
use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
910
use PhpCsFixer\Tokenizer\Token;
@@ -20,10 +21,7 @@
2021
*/
2122
final class ArrayListItemNewlineFixer extends AbstractSymplifyFixer
2223
{
23-
/**
24-
* @var string
25-
*/
26-
private const ERROR_MESSAGE = 'Indexed PHP array item has to have one line per item';
24+
private const string ERROR_MESSAGE = 'Indexed PHP array item has to have one line per item';
2725

2826
public function __construct(
2927
private readonly ArrayItemNewliner $arrayItemNewliner,
@@ -37,6 +35,7 @@ public function getDefinition(): FixerDefinitionInterface
3735
return new FixerDefinition(self::ERROR_MESSAGE, []);
3836
}
3937

38+
#[Override]
4039
public function getPriority(): int
4140
{
4241
return 40;

src/Fixer/ArrayNotation/ArrayOpenerAndCloserNewlineFixer.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Symplify\CodingStandard\Fixer\ArrayNotation;
66

7+
use Override;
78
use PhpCsFixer\FixerDefinition\FixerDefinition;
89
use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
910
use PhpCsFixer\Tokenizer\Token;
@@ -22,10 +23,7 @@
2223
*/
2324
final class ArrayOpenerAndCloserNewlineFixer extends AbstractSymplifyFixer
2425
{
25-
/**
26-
* @var string
27-
*/
28-
private const ERROR_MESSAGE = 'Indexed PHP array opener [ and closer ] must be on own line';
26+
private const string ERROR_MESSAGE = 'Indexed PHP array opener [ and closer ] must be on own line';
2927

3028
public function __construct(
3129
private readonly ArrayBlockInfoFinder $arrayBlockInfoFinder,
@@ -44,6 +42,7 @@ public function getDefinition(): FixerDefinitionInterface
4442
*
4543
* @see \PhpCsFixer\Fixer\Whitespace\ArrayIndentationFixer::getPriority()
4644
*/
45+
#[Override]
4746
public function getPriority(): int
4847
{
4948
return 34;

0 commit comments

Comments
 (0)