Skip to content

Commit 4694e38

Browse files
committed
bump to PHP 8.3
1 parent d35ff1a commit 4694e38

26 files changed

+69
-160
lines changed

rector.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010

1111
return RectorConfig::configure()
1212
->withImportNames(removeUnusedImports: true)
13-
->withPhpSets(php82: true)
13+
->withPhpSets()
1414
->withComposerBased(phpunit: true)
1515
->withPreparedSets(
1616
deadCode: true,
1717
codeQuality: true,
1818
codingStyle: true,
1919
typeDeclarations: true,
20+
typeDeclarationDocblocks: true,
2021
privatization: true,
2122
naming: true,
2223
earlyReturn: true,

rules/DowngradePhp72/NodeAnalyzer/RegexFuncAnalyzer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/**
1616
* @var string[]
1717
*/
18-
private const REGEX_FUNCTION_NAMES = ['preg_match', 'preg_match_all'];
18+
private const array REGEX_FUNCTION_NAMES = ['preg_match', 'preg_match_all'];
1919

2020
public function __construct(
2121
private NodeNameResolver $nodeNameResolver,

rules/DowngradePhp72/Rector/ConstFetch/DowngradePhp72JsonConstRector.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@
2424
*/
2525
final class DowngradePhp72JsonConstRector extends AbstractRector
2626
{
27-
/**
28-
* @var string
29-
*/
30-
private const PHP72_JSON_CONSTANT_IS_KNOWN = 'php72_json_constant_is_known';
27+
private const string PHP72_JSON_CONSTANT_IS_KNOWN = 'php72_json_constant_is_known';
3128

3229
public function __construct(
3330
private readonly JsonConstCleaner $jsonConstCleaner,

rules/DowngradePhp72/Rector/FuncCall/DowngradePregUnmatchedAsNullConstantRector.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ final class DowngradePregUnmatchedAsNullConstantRector extends AbstractRector
3434
{
3535
/**
3636
* @see https://www.php.net/manual/en/function.preg-match.php
37-
* @var string
3837
*/
39-
private const UNMATCHED_NULL_FLAG = 'PREG_UNMATCHED_AS_NULL';
38+
private const string UNMATCHED_NULL_FLAG = 'PREG_UNMATCHED_AS_NULL';
4039

4140
public function __construct(
4241
private readonly BitwiseFlagCleaner $bitwiseFlagCleaner,

rules/DowngradePhp73/Rector/ConstFetch/DowngradePhp73JsonConstRector.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,12 @@
3434
*/
3535
final class DowngradePhp73JsonConstRector extends AbstractRector
3636
{
37-
/**
38-
* @var string
39-
*/
40-
private const PHP73_JSON_CONSTANT_IS_KNOWN = 'php73_json_constant_is_known';
37+
private const string PHP73_JSON_CONSTANT_IS_KNOWN = 'php73_json_constant_is_known';
4138

4239
/**
4340
* @var array<string>
4441
*/
45-
private const JSON_FUNCTIONS = ['json_decode', 'json_encode'];
42+
private const array JSON_FUNCTIONS = ['json_decode', 'json_encode'];
4643

4744
public function __construct(
4845
private readonly JsonConstCleaner $jsonConstCleaner,

rules/DowngradePhp73/Rector/FuncCall/SetCookieOptionsArrayToArgumentsRector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class SetCookieOptionsArrayToArgumentsRector extends AbstractRector
2525
* Conversion table from argument index to options name
2626
* @var array<string, int>
2727
*/
28-
private const ARGUMENT_ORDER = [
28+
private const array ARGUMENT_ORDER = [
2929
'expires' => 2,
3030
'path' => 3,
3131
'domain' => 4,
@@ -37,7 +37,7 @@ final class SetCookieOptionsArrayToArgumentsRector extends AbstractRector
3737
* Conversion table from argument index to options name
3838
* @var array<int, int|string|bool>
3939
*/
40-
private const ARGUMENT_DEFAULT_VALUES = [
40+
private const array ARGUMENT_DEFAULT_VALUES = [
4141
2 => 0,
4242
3 => '',
4343
4 => '',

rules/DowngradePhp73/Rector/List_/DowngradeListReferenceAssignmentRector.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,9 @@
2626
*/
2727
final class DowngradeListReferenceAssignmentRector extends AbstractRector
2828
{
29-
/**
30-
* @var int
31-
*/
32-
private const ALL = 0;
29+
private const int ALL = 0;
3330

34-
/**
35-
* @var int
36-
*/
37-
private const ANY = 1;
31+
private const int ANY = 1;
3832

3933
public function getRuleDefinition(): RuleDefinition
4034
{

rules/DowngradePhp73/Rector/String_/DowngradeFlexibleHeredocSyntaxRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class DowngradeFlexibleHeredocSyntaxRector extends AbstractRector
2121
/**
2222
* @var int[]
2323
*/
24-
private const HERENOW_DOC_KINDS = [String_::KIND_HEREDOC, String_::KIND_NOWDOC];
24+
private const array HERENOW_DOC_KINDS = [String_::KIND_HEREDOC, String_::KIND_NOWDOC];
2525

2626
public function __construct(
2727
private readonly FollowedByNewlineOnlyMaybeWithSemicolonAnalyzer $followedByNewlineOnlyMaybeWithSemicolonAnalyzer

rules/DowngradePhp74/Rector/Identical/DowngradeFreadFwriteFalsyToNegationRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ final class DowngradeFreadFwriteFalsyToNegationRector extends AbstractRector
2222
/**
2323
* @var string[]
2424
*/
25-
private const FUNC_FREAD_FWRITE = ['fread', 'fwrite'];
25+
private const array FUNC_FREAD_FWRITE = ['fread', 'fwrite'];
2626

2727
public function __construct(
2828
private readonly ValueResolver $valueResolver

0 commit comments

Comments
 (0)