Skip to content

Commit e5dbba2

Browse files
committed
upgrade syntax to PHP 8.3
1 parent 54289ee commit e5dbba2

52 files changed

Lines changed: 258 additions & 621 deletions

File tree

Some content is hidden

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

phpstan.neon

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ parameters:
6767

6868
- '#Parameter 1 should use "PHPStan\\BetterReflection\\Reflection\\Adapter\\ReflectionMethod" type as the only type passed to this method#'
6969

70-
# local use php 8.3
71-
- identifier: typeCoverage.constantTypeCoverage
72-
7370
# in tests
7471
-
7572
message: '#Fetching deprecated class constant SYMFONY_(.*?) of class Rector\\Symfony\\Set\\SymfonySetList#'

rector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@
3737
// marked as skipped
3838
ReturnNeverTypeRector::class => ['*/tests/*'],
3939
])
40-
// @todo cleanup rest and move to enum classes ass single place for class names
4140
->withConfiguredRule(StringClassNameToClassConstantRector::class, ['Symfony\*', 'Twig_*', 'Twig*'])
4241
->withPhpSets()
4342
->withPreparedSets(
4443
deadCode: true,
4544
codeQuality: true,
4645
codingStyle: true,
4746
typeDeclarations: true,
47+
typeDeclarationDocblocks: true,
4848
privatization: true,
4949
naming: true,
5050
rectorPreset: true,

rules/CodeQuality/Enum/ResponseClass.php

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,13 @@
66

77
final class ResponseClass
88
{
9-
/**
10-
* @var string
11-
*/
12-
public const REDIRECT = 'Symfony\Component\HttpFoundation\RedirectResponse';
9+
public const string REDIRECT = 'Symfony\Component\HttpFoundation\RedirectResponse';
1310

14-
/**
15-
* @var string
16-
*/
17-
public const BINARY_FILE = 'Symfony\Component\HttpFoundation\BinaryFileResponse';
11+
public const string BINARY_FILE = 'Symfony\Component\HttpFoundation\BinaryFileResponse';
1812

19-
/**
20-
* @var string
21-
*/
22-
public const JSON = 'Symfony\Component\HttpFoundation\JsonResponse';
13+
public const string JSON = 'Symfony\Component\HttpFoundation\JsonResponse';
2314

24-
/**
25-
* @var string
26-
*/
27-
public const STREAMED = 'Symfony\Component\HttpFoundation\StreamedResponse';
15+
public const string STREAMED = 'Symfony\Component\HttpFoundation\StreamedResponse';
2816

29-
/**
30-
* @var string
31-
*/
32-
public const BASIC = 'Symfony\Component\HttpFoundation\Response';
17+
public const string BASIC = 'Symfony\Component\HttpFoundation\Response';
3318
}

rules/CodeQuality/Rector/Class_/ControllerMethodInjectionToConstructorRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ final class ControllerMethodInjectionToConstructorRector extends AbstractRector
3737
/**
3838
* @var string[]
3939
*/
40-
private const COMMON_ENTITY_CONTAINS_SUBNAMESPACES = ["\\Entity", "\\Document", "\\Model"];
40+
private const array COMMON_ENTITY_CONTAINS_SUBNAMESPACES = ["\\Entity", "\\Document", "\\Model"];
4141

4242
public function __construct(
4343
private readonly ControllerAnalyzer $controllerAnalyzer,

rules/CodeQuality/Rector/Class_/EventListenerToEventSubscriberRector.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@
2828
final class EventListenerToEventSubscriberRector extends AbstractRector
2929
{
3030
/**
31-
* @var string
3231
* @changelog https://regex101.com/r/qiHZ4T/1
3332
*/
34-
private const LISTENER_MATCH_REGEX = '#^(.*?)(Listener)?$#';
33+
private const string LISTENER_MATCH_REGEX = '#^(.*?)(Listener)?$#';
3534

3635
/**
3736
* @var EventNameToClassAndConstant[]

rules/CodeQuality/Rector/Class_/InlineClassRoutePrefixRector.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,13 @@ final class InlineClassRoutePrefixRector extends AbstractRector
3333
/**
3434
* @var string[]
3535
*/
36-
private const FOS_REST_ANNOTATIONS = [
36+
private const array FOS_REST_ANNOTATIONS = [
3737
FosAnnotation::REST_POST,
3838
FosAnnotation::REST_GET,
3939
FosAnnotation::REST_ROUTE,
4040
];
4141

42-
/**
43-
* @var string
44-
*/
45-
private const PATH = 'path';
42+
private const string PATH = 'path';
4643

4744
public function __construct(
4845
private readonly PhpDocInfoFactory $phpDocInfoFactory,

rules/Configs/NodeVisitor/CollectServiceArgumentsNodeVisitor.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,9 @@
2222

2323
final class CollectServiceArgumentsNodeVisitor extends NodeVisitorAbstract
2424
{
25-
/**
26-
* @var string
27-
*/
28-
private const ENVS = 'envs';
25+
private const string ENVS = 'envs';
2926

30-
/**
31-
* @var string
32-
*/
33-
private const PARAMETERS = 'parameters';
27+
private const string PARAMETERS = 'parameters';
3428

3529
/**
3630
* @var array<string, array<self::ENVS|self::PARAMETERS, array<string|Expr>>>

rules/Configs/Rector/Class_/AutowireAttributeRector.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@
3535
*/
3636
final class AutowireAttributeRector extends AbstractRector implements ConfigurableRectorInterface
3737
{
38-
/**
39-
* @var string
40-
*/
41-
public const CONFIGS_DIRECTORY = 'configs_directory';
38+
public const string CONFIGS_DIRECTORY = 'configs_directory';
4239

4340
private ?string $configsDirectory = null;
4441

rules/Configs/Rector/Closure/ServiceTagsToDefaultsAutoconfigureRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class ServiceTagsToDefaultsAutoconfigureRector extends AbstractRector
2323
/**
2424
* @var string[]
2525
*/
26-
private const AUTOCONFIGUREABLE_TAGS = [
26+
private const array AUTOCONFIGUREABLE_TAGS = [
2727
// @todo fill
2828
'twig.extension',
2929
'console.command',

rules/DependencyInjection/Rector/Class_/GetBySymfonyStringToConstructorInjectionRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ final class GetBySymfonyStringToConstructorInjectionRector extends AbstractRecto
2727
/**
2828
* @var array<string, string>
2929
*/
30-
private const SYMFONY_NAME_TO_TYPE_MAP = [
30+
private const array SYMFONY_NAME_TO_TYPE_MAP = [
3131
'validator' => SymfonyClass::VALIDATOR_INTERFACE,
3232
'event_dispatcher' => SymfonyClass::EVENT_DISPATCHER_INTERFACE,
3333
'logger' => SymfonyClass::LOGGER_INTERFACE,

0 commit comments

Comments
 (0)