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 build/target-repository/e2e/dont-execute-code/rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
declare(strict_types=1);

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

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([__DIR__.'/src']);

$rectorConfig->sets([SetList::PHP_53]);
$rectorConfig->sets([__DIR__ . '/vendor/rector/rector/config/set/php53.php']);
};
3 changes: 1 addition & 2 deletions build/target-repository/e2e/parse-php7-code/rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
declare(strict_types=1);

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

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([__DIR__.'/src']);

$rectorConfig->sets([SetList::PHP_53]);
$rectorConfig->sets([__DIR__ . '/vendor/rector/rector/config/set/php53.php']);
};
3 changes: 1 addition & 2 deletions build/target-repository/e2e/parse-php8-code/rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
declare(strict_types=1);

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

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([__DIR__.'/src']);

$rectorConfig->sets([SetList::PHP_53]);
$rectorConfig->sets([__DIR__ . '/vendor/rector/rector/config/set/php53.php']);
};
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"shipmonk/dead-code-detector": "^1.4",
"symfony/process": "^8.1",
"symplify/easy-coding-standard": "^13.3.11",
"symplify/phpstan-rules": "^14.19",
"symplify/phpstan-rules": "^14.19.4",
"tomasvotruba/class-leak": "^2.3.4",
"tomasvotruba/fast-unit": "^0.1",
"tomasvotruba/type-coverage": "^2.5"
Expand Down
3 changes: 1 addition & 2 deletions config/set/level/up-to-php53.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\SetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([SetList::PHP_53, SetList::PHP_52]);
$rectorConfig->sets([__DIR__ . '/../php53.php', __DIR__ . '/../php52.php']);
};
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 @@ -4,8 +4,7 @@

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

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([SetList::PHP_54, LevelSetList::UP_TO_PHP_53]);
$rectorConfig->sets([__DIR__ . '/../php54.php', LevelSetList::UP_TO_PHP_53]);
};
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 @@ -4,8 +4,7 @@

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

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([SetList::PHP_55, LevelSetList::UP_TO_PHP_54]);
$rectorConfig->sets([__DIR__ . '/../php55.php', LevelSetList::UP_TO_PHP_54]);
};
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 @@ -4,8 +4,7 @@

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

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([SetList::PHP_56, LevelSetList::UP_TO_PHP_55]);
$rectorConfig->sets([__DIR__ . '/../php56.php', LevelSetList::UP_TO_PHP_55]);
};
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 @@ -4,8 +4,7 @@

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

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([SetList::PHP_70, LevelSetList::UP_TO_PHP_56]);
$rectorConfig->sets([__DIR__ . '/../php70.php', LevelSetList::UP_TO_PHP_56]);
};
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 @@ -4,8 +4,7 @@

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

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([SetList::PHP_71, LevelSetList::UP_TO_PHP_70]);
$rectorConfig->sets([__DIR__ . '/../php71.php', LevelSetList::UP_TO_PHP_70]);
};
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 @@ -4,8 +4,7 @@

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

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([SetList::PHP_72, LevelSetList::UP_TO_PHP_71]);
$rectorConfig->sets([__DIR__ . '/../php72.php', LevelSetList::UP_TO_PHP_71]);
};
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 @@ -4,8 +4,7 @@

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

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([SetList::PHP_73, LevelSetList::UP_TO_PHP_72]);
$rectorConfig->sets([__DIR__ . '/../php73.php', LevelSetList::UP_TO_PHP_72]);
};
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 @@ -4,8 +4,7 @@

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

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([SetList::PHP_74, LevelSetList::UP_TO_PHP_73]);
$rectorConfig->sets([__DIR__ . '/../php74.php', LevelSetList::UP_TO_PHP_73]);
};
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 @@ -4,8 +4,7 @@

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

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([SetList::PHP_80, LevelSetList::UP_TO_PHP_74]);
$rectorConfig->sets([__DIR__ . '/../php80.php', LevelSetList::UP_TO_PHP_74]);
};
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 @@ -4,8 +4,7 @@

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

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([SetList::PHP_81, LevelSetList::UP_TO_PHP_80]);
$rectorConfig->sets([__DIR__ . '/../php81.php', LevelSetList::UP_TO_PHP_80]);
};
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 @@ -4,8 +4,7 @@

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

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([SetList::PHP_82, LevelSetList::UP_TO_PHP_81]);
$rectorConfig->sets([__DIR__ . '/../php82.php', LevelSetList::UP_TO_PHP_81]);
};
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 @@ -4,8 +4,7 @@

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

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([SetList::PHP_83, LevelSetList::UP_TO_PHP_82]);
$rectorConfig->sets([__DIR__ . '/../php83.php', LevelSetList::UP_TO_PHP_82]);
};
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 @@ -4,8 +4,7 @@

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

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([SetList::PHP_84, LevelSetList::UP_TO_PHP_83]);
$rectorConfig->sets([__DIR__ . '/../php84.php', LevelSetList::UP_TO_PHP_83]);
};
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 @@ -4,8 +4,7 @@

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

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([SetList::PHP_85, LevelSetList::UP_TO_PHP_84]);
$rectorConfig->sets([__DIR__ . '/../php85.php', LevelSetList::UP_TO_PHP_84]);
};
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 @@ -4,8 +4,7 @@

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

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([SetList::PHP_86, LevelSetList::UP_TO_PHP_85]);
$rectorConfig->sets([__DIR__ . '/../php86.php', LevelSetList::UP_TO_PHP_85]);
};
7 changes: 0 additions & 7 deletions phpstan-deprecated.neon
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,3 @@ parameters:
identifier: classConstant.deprecated
paths:
- src/Configuration/RectorConfigBuilder.php

# the deprecated SetList::PHP_* constants are still resolved internally by the level sets and their tests
-
identifier: classConstant.deprecated
paths:
- config/set/level
- tests/Bridge/SetRectorsResolverTest.php
85 changes: 0 additions & 85 deletions src/Set/ValueObject/SetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,91 +29,6 @@ final class SetList
*/
public const string RECTOR_PRESET = __DIR__ . '/../../../config/set/rector-preset.php';

/**
* @deprecated Use withPhpSets() or withPhpLevel() instead
*/
public const string PHP_52 = __DIR__ . '/../../../config/set/php52.php';

/**
* @deprecated Use withPhpSets() or withPhpLevel() instead
*/
public const string PHP_53 = __DIR__ . '/../../../config/set/php53.php';

/**
* @deprecated Use withPhpSets() or withPhpLevel() instead
*/
public const string PHP_54 = __DIR__ . '/../../../config/set/php54.php';

/**
* @deprecated Use withPhpSets() or withPhpLevel() instead
*/
public const string PHP_55 = __DIR__ . '/../../../config/set/php55.php';

/**
* @deprecated Use withPhpSets() or withPhpLevel() instead
*/
public const string PHP_56 = __DIR__ . '/../../../config/set/php56.php';

/**
* @deprecated Use withPhpSets() or withPhpLevel() instead
*/
public const string PHP_70 = __DIR__ . '/../../../config/set/php70.php';

/**
* @deprecated Use withPhpSets() or withPhpLevel() instead
*/
public const string PHP_71 = __DIR__ . '/../../../config/set/php71.php';

/**
* @deprecated Use withPhpSets() or withPhpLevel() instead
*/
public const string PHP_72 = __DIR__ . '/../../../config/set/php72.php';

/**
* @deprecated Use withPhpSets() or withPhpLevel() instead
*/
public const string PHP_73 = __DIR__ . '/../../../config/set/php73.php';

/**
* @deprecated Use withPhpSets() or withPhpLevel() instead
*/
public const string PHP_74 = __DIR__ . '/../../../config/set/php74.php';

/**
* @deprecated Use withPhpSets() or withPhpLevel() instead
*/
public const string PHP_80 = __DIR__ . '/../../../config/set/php80.php';

/**
* @deprecated Use withPhpSets() or withPhpLevel() instead
*/
public const string PHP_81 = __DIR__ . '/../../../config/set/php81.php';

/**
* @deprecated Use withPhpSets() or withPhpLevel() instead
*/
public const string PHP_82 = __DIR__ . '/../../../config/set/php82.php';

/**
* @deprecated Use withPhpSets() or withPhpLevel() instead
*/
public const string PHP_83 = __DIR__ . '/../../../config/set/php83.php';

/**
* @deprecated Use withPhpSets() or withPhpLevel() instead
*/
public const string PHP_84 = __DIR__ . '/../../../config/set/php84.php';

/**
* @deprecated Use withPhpSets() or withPhpLevel() instead
*/
public const string PHP_85 = __DIR__ . '/../../../config/set/php85.php';

/**
* @deprecated Use withPhpSets() or withPhpLevel() instead
*/
public const string PHP_86 = __DIR__ . '/../../../config/set/php86.php';

public const string PRIVATIZATION = __DIR__ . '/../../../config/set/privatization.php';

public const string TYPE_DECLARATION = __DIR__ . '/../../../config/set/type-declaration.php';
Expand Down
3 changes: 1 addition & 2 deletions tests/Bridge/SetRectorsResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use PHPUnit\Framework\TestCase;
use Rector\Bridge\SetRectorsResolver;
use Rector\Contract\Rector\RectorInterface;
use Rector\Set\ValueObject\SetList;

final class SetRectorsResolverTest extends TestCase
{
Expand All @@ -33,7 +32,7 @@ public function testResolvePhpVersionBasedSet(): void
public function testResolveWithConfiguration(): void
{
$rectorRulesWithConfiguration = $this->setRectorsResolver->resolveFromFilePathIncludingConfiguration(
SetList::PHP_73
__DIR__ . '/../../config/set/php73.php'
);
$this->assertCount(10, $rectorRulesWithConfiguration);

Expand Down
Loading