Skip to content

Commit 98f0cb1

Browse files
committed
chore: add php 8.6 support
1 parent 2d8958e commit 98f0cb1

File tree

7 files changed

+31
-0
lines changed

7 files changed

+31
-0
lines changed

config/set/level/up-to-php86.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\Config\RectorConfig;
6+
use Rector\Set\ValueObject\LevelSetList;
7+
use Rector\Set\ValueObject\SetList;
8+
9+
return static function (RectorConfig $rectorConfig): void {
10+
$rectorConfig->sets([SetList::PHP_86, LevelSetList::UP_TO_PHP_85]);
11+
};

config/set/php86.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\Config\RectorConfig;
6+
7+
return static function (RectorConfig $rectorConfig): void {
8+
$rectorConfig->rules([
9+
]);
10+
};

src/Configuration/PhpLevelSetResolver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ final class PhpLevelSetResolver
3535
PhpVersion::PHP_83 => SetList::PHP_83,
3636
PhpVersion::PHP_84 => SetList::PHP_84,
3737
PhpVersion::PHP_85 => SetList::PHP_85,
38+
PhpVersion::PHP_86 => SetList::PHP_86,
3839
];
3940

4041
/**

src/Configuration/RectorConfigBuilder.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,7 @@ public function withPhpSets(
574574
// place on later as BC break when used in php 7.x without named arg
575575
bool $php84 = false,
576576
bool $php85 = false,
577+
bool $php86 = false,
577578
): self {
578579
if ($this->isWithPhpSetsUsed === true) {
579580
throw new InvalidConfigurationException(sprintf(
@@ -665,6 +666,8 @@ public function withPhpSets(
665666
$targetPhpVersion = PhpVersion::PHP_84;
666667
} elseif ($php85) {
667668
$targetPhpVersion = PhpVersion::PHP_85;
669+
} elseif ($php86) {
670+
$targetPhpVersion = PhpVersion::PHP_86;
668671
} else {
669672
throw new InvalidConfigurationException('Invalid PHP version set');
670673
}

src/Set/ValueObject/LevelSetList.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
*/
1010
final class LevelSetList
1111
{
12+
public const string UP_TO_PHP_86 = __DIR__ . '/../../../config/set/level/up-to-php86.php';
13+
1214
public const string UP_TO_PHP_85 = __DIR__ . '/../../../config/set/level/up-to-php85.php';
1315

1416
public const string UP_TO_PHP_84 = __DIR__ . '/../../../config/set/level/up-to-php84.php';

src/Set/ValueObject/SetList.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ final class SetList
6666

6767
public const string PHP_85 = __DIR__ . '/../../../config/set/php85.php';
6868

69+
public const string PHP_86 = __DIR__ . '/../../../config/set/php86.php';
70+
6971
public const string PRIVATIZATION = __DIR__ . '/../../../config/set/privatization.php';
7072

7173
public const string TYPE_DECLARATION = __DIR__ . '/../../../config/set/type-declaration.php';

src/ValueObject/PhpVersion.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,7 @@ final class PhpVersion
4141

4242
public const int PHP_85 = 80500;
4343

44+
public const int PHP_86 = 80600;
45+
4446
public const int PHP_10 = 100000;
4547
}

0 commit comments

Comments
 (0)