Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions config/set/level/up-to-php54.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([__DIR__ . '/../php54.php', LevelSetList::UP_TO_PHP_53]);
$rectorConfig->sets([__DIR__ . '/../php54.php', __DIR__ . '/up-to-php53.php']);
};
3 changes: 1 addition & 2 deletions config/set/level/up-to-php55.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([__DIR__ . '/../php55.php', LevelSetList::UP_TO_PHP_54]);
$rectorConfig->sets([__DIR__ . '/../php55.php', __DIR__ . '/up-to-php54.php']);
};
3 changes: 1 addition & 2 deletions config/set/level/up-to-php56.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([__DIR__ . '/../php56.php', LevelSetList::UP_TO_PHP_55]);
$rectorConfig->sets([__DIR__ . '/../php56.php', __DIR__ . '/up-to-php55.php']);
};
3 changes: 1 addition & 2 deletions config/set/level/up-to-php70.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([__DIR__ . '/../php70.php', LevelSetList::UP_TO_PHP_56]);
$rectorConfig->sets([__DIR__ . '/../php70.php', __DIR__ . '/up-to-php56.php']);
};
3 changes: 1 addition & 2 deletions config/set/level/up-to-php71.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([__DIR__ . '/../php71.php', LevelSetList::UP_TO_PHP_70]);
$rectorConfig->sets([__DIR__ . '/../php71.php', __DIR__ . '/up-to-php70.php']);
};
3 changes: 1 addition & 2 deletions config/set/level/up-to-php72.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([__DIR__ . '/../php72.php', LevelSetList::UP_TO_PHP_71]);
$rectorConfig->sets([__DIR__ . '/../php72.php', __DIR__ . '/up-to-php71.php']);
};
3 changes: 1 addition & 2 deletions config/set/level/up-to-php73.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([__DIR__ . '/../php73.php', LevelSetList::UP_TO_PHP_72]);
$rectorConfig->sets([__DIR__ . '/../php73.php', __DIR__ . '/up-to-php72.php']);
};
3 changes: 1 addition & 2 deletions config/set/level/up-to-php74.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([__DIR__ . '/../php74.php', LevelSetList::UP_TO_PHP_73]);
$rectorConfig->sets([__DIR__ . '/../php74.php', __DIR__ . '/up-to-php73.php']);
};
3 changes: 1 addition & 2 deletions config/set/level/up-to-php80.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([__DIR__ . '/../php80.php', LevelSetList::UP_TO_PHP_74]);
$rectorConfig->sets([__DIR__ . '/../php80.php', __DIR__ . '/up-to-php74.php']);
};
3 changes: 1 addition & 2 deletions config/set/level/up-to-php81.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([__DIR__ . '/../php81.php', LevelSetList::UP_TO_PHP_80]);
$rectorConfig->sets([__DIR__ . '/../php81.php', __DIR__ . '/up-to-php80.php']);
};
3 changes: 1 addition & 2 deletions config/set/level/up-to-php82.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([__DIR__ . '/../php82.php', LevelSetList::UP_TO_PHP_81]);
$rectorConfig->sets([__DIR__ . '/../php82.php', __DIR__ . '/up-to-php81.php']);
};
3 changes: 1 addition & 2 deletions config/set/level/up-to-php83.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([__DIR__ . '/../php83.php', LevelSetList::UP_TO_PHP_82]);
$rectorConfig->sets([__DIR__ . '/../php83.php', __DIR__ . '/up-to-php82.php']);
};
3 changes: 1 addition & 2 deletions config/set/level/up-to-php84.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([__DIR__ . '/../php84.php', LevelSetList::UP_TO_PHP_83]);
$rectorConfig->sets([__DIR__ . '/../php84.php', __DIR__ . '/up-to-php83.php']);
};
3 changes: 1 addition & 2 deletions config/set/level/up-to-php85.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([__DIR__ . '/../php85.php', LevelSetList::UP_TO_PHP_84]);
$rectorConfig->sets([__DIR__ . '/../php85.php', __DIR__ . '/up-to-php84.php']);
};
3 changes: 1 addition & 2 deletions config/set/level/up-to-php86.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([__DIR__ . '/../php86.php', LevelSetList::UP_TO_PHP_85]);
$rectorConfig->sets([__DIR__ . '/../php86.php', __DIR__ . '/up-to-php85.php']);
};
4 changes: 2 additions & 2 deletions src/Configuration/RectorConfigBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ final class RectorConfigBuilder
private const int MAX_LEVEL_GAP = 10;

/**
* Matches the deprecated per-version PHP set files, e.g. .../config/set/php82.php
* Matches the deprecated per-version PHP set files, e.g. .../config/set/php82.php or .../config/set/level/up-to-php82.php
*/
private const string DEPRECATED_PHP_SET_REGEX = '#/config/set/php\d+\.php$#';
private const string DEPRECATED_PHP_SET_REGEX = '#/config/set/(level/up-to-)?php\d+\.php$#';

/**
* A level method and the set that contains the very same rules,
Expand Down
1 change: 1 addition & 0 deletions src/Set/ValueObject/LevelSetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

/**
* @api
* @deprecated Use withPhpSets() or withPhpLevel() instead
*/
final class LevelSetList
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@

use Rector\Config\RectorConfig;
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\ValueObject\PhpVersion;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([LevelSetList::UP_TO_PHP_81]);
$rectorConfig->sets([SetList::PHP_VERSION_BASED_SET]);
$rectorConfig->phpVersion(PhpVersion::PHP_81);

$rectorConfig->ruleWithConfiguration(StringClassNameToClassConstantRector::class, ['Doctrine\*']);
};
Loading