diff --git a/phpstan.neon b/phpstan.neon index 24654e6061d..04115d03e40 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -317,6 +317,18 @@ parameters: message: '#Fetching (deprecated )?class constant (.*?) of (deprecated )?class (Rector\\Set\\ValueObject\\DowngradeLevelSetList|Rector\\Symfony\\Set\\(.*?))#' path: src/Configuration/RectorConfigBuilder.php + # the deprecated set objects are still resolved internally, until every extension bonds its rules + - + message: '#deprecated (class|interface) Rector\\(Set|Bridge)\\#' + paths: + - src/Set/SetManager.php + - src/Set/SetProvider/CoreSetProvider.php + - src/Set/SetProvider/PHPSetProvider.php + - src/Bridge/SetProviderCollector.php + - src/Configuration/RectorConfigBuilder.php + - tests/Set/ValueObject/ComposerTriggeredSetTest.php + - tests/Set/SetManager/SetManagerTest.php + # runtime comparison - '#Comparison operation ".*" between int<\d+, \d+> and \d+ is always true#' diff --git a/src/Bridge/SetProviderCollector.php b/src/Bridge/SetProviderCollector.php index 2697ec553c4..c83f8309482 100644 --- a/src/Bridge/SetProviderCollector.php +++ b/src/Bridge/SetProviderCollector.php @@ -16,6 +16,13 @@ * @api * * Utils class to ease building bridges by 3rd-party tools + * + * @deprecated Bond the rules themselves instead, by implementing the ComposerPackageConstraintInterface. A set + * described as an object only existed to be matched against the installed packages; a bonded rule states the exact + * package version its target API is available from and applies from there upwards, so a plain set file is enough. + * + * @see \Rector\VersionBonding\Contract\ComposerPackageConstraintInterface + * @see https://github.com/rectorphp/rector-src/pull/8296 */ final readonly class SetProviderCollector { diff --git a/src/Set/Contract/SetInterface.php b/src/Set/Contract/SetInterface.php index 3f3fb3d0455..f32334a6e36 100644 --- a/src/Set/Contract/SetInterface.php +++ b/src/Set/Contract/SetInterface.php @@ -4,6 +4,14 @@ namespace Rector\Set\Contract; +/** + * @deprecated Bond the rules themselves instead, by implementing the ComposerPackageConstraintInterface. A set + * described as an object only existed to be matched against the installed packages; a bonded rule states the exact + * package version its target API is available from and applies from there upwards, so a plain set file is enough. + * + * @see \Rector\VersionBonding\Contract\ComposerPackageConstraintInterface + * @see https://github.com/rectorphp/rector-src/pull/8296 + */ interface SetInterface { public function getGroupName(): string; diff --git a/src/Set/Contract/SetProviderInterface.php b/src/Set/Contract/SetProviderInterface.php index 00a37dcc9b1..23bc119ca41 100644 --- a/src/Set/Contract/SetProviderInterface.php +++ b/src/Set/Contract/SetProviderInterface.php @@ -4,6 +4,14 @@ namespace Rector\Set\Contract; +/** + * @deprecated Bond the rules themselves instead, by implementing the ComposerPackageConstraintInterface. A set + * described as an object only existed to be matched against the installed packages; a bonded rule states the exact + * package version its target API is available from and applies from there upwards, so a plain set file is enough. + * + * @see \Rector\VersionBonding\Contract\ComposerPackageConstraintInterface + * @see https://github.com/rectorphp/rector-src/pull/8296 + */ interface SetProviderInterface { /** diff --git a/src/Set/SetManager.php b/src/Set/SetManager.php index da1960d1e1e..22d6f04fdea 100644 --- a/src/Set/SetManager.php +++ b/src/Set/SetManager.php @@ -11,6 +11,13 @@ /** * @see \Rector\Tests\Set\SetManager\SetManagerTest + * + * @deprecated Bond the rules themselves instead, by implementing the ComposerPackageConstraintInterface. A set + * described as an object only existed to be matched against the installed packages; a bonded rule states the exact + * package version its target API is available from and applies from there upwards, so a plain set file is enough. + * + * @see \Rector\VersionBonding\Contract\ComposerPackageConstraintInterface + * @see https://github.com/rectorphp/rector-src/pull/8296 */ final readonly class SetManager { diff --git a/src/Set/SetProvider/CoreSetProvider.php b/src/Set/SetProvider/CoreSetProvider.php index 1ce42614582..04b80d582f8 100644 --- a/src/Set/SetProvider/CoreSetProvider.php +++ b/src/Set/SetProvider/CoreSetProvider.php @@ -9,6 +9,14 @@ use Rector\Set\Enum\SetGroup; use Rector\Set\ValueObject\Set; +/** + * @deprecated Bond the rules themselves instead, by implementing the ComposerPackageConstraintInterface. A set + * described as an object only existed to be matched against the installed packages; a bonded rule states the exact + * package version its target API is available from and applies from there upwards, so a plain set file is enough. + * + * @see \Rector\VersionBonding\Contract\ComposerPackageConstraintInterface + * @see https://github.com/rectorphp/rector-src/pull/8296 + */ final class CoreSetProvider implements SetProviderInterface { /** diff --git a/src/Set/SetProvider/PHPSetProvider.php b/src/Set/SetProvider/PHPSetProvider.php index 513d94855a7..a74fdfa628f 100644 --- a/src/Set/SetProvider/PHPSetProvider.php +++ b/src/Set/SetProvider/PHPSetProvider.php @@ -9,6 +9,14 @@ use Rector\Set\Enum\SetGroup; use Rector\Set\ValueObject\Set; +/** + * @deprecated Bond the rules themselves instead, by implementing the ComposerPackageConstraintInterface. A set + * described as an object only existed to be matched against the installed packages; a bonded rule states the exact + * package version its target API is available from and applies from there upwards, so a plain set file is enough. + * + * @see \Rector\VersionBonding\Contract\ComposerPackageConstraintInterface + * @see https://github.com/rectorphp/rector-src/pull/8296 + */ final class PHPSetProvider implements SetProviderInterface { /** diff --git a/src/Set/ValueObject/ComposerTriggeredSet.php b/src/Set/ValueObject/ComposerTriggeredSet.php index eac453f6de5..1193322c5c7 100644 --- a/src/Set/ValueObject/ComposerTriggeredSet.php +++ b/src/Set/ValueObject/ComposerTriggeredSet.php @@ -12,6 +12,14 @@ /** * @api used by extensions + * + * @deprecated Bond the rules themselves instead, by implementing the ComposerPackageConstraintInterface. A set + * triggered on a single major version has to be repeated for every version an upgrade passes through, while a bonded + * rule states the exact package version its target API is available from and applies from there upwards. + * + * @see \Rector\VersionBonding\Contract\ComposerPackageConstraintInterface + * @see https://github.com/rectorphp/rector-src/pull/8296 + * * @see \Rector\Tests\Set\ValueObject\ComposerTriggeredSetTest */ final readonly class ComposerTriggeredSet implements SetInterface diff --git a/src/Set/ValueObject/Set.php b/src/Set/ValueObject/Set.php index 5e3d05bf307..75b5834b1ef 100644 --- a/src/Set/ValueObject/Set.php +++ b/src/Set/ValueObject/Set.php @@ -9,6 +9,13 @@ /** * @api used by extensions + * + * @deprecated Bond the rules themselves instead, by implementing the ComposerPackageConstraintInterface. A set + * described as an object only existed to be matched against the installed packages; a bonded rule states the exact + * package version its target API is available from and applies from there upwards, so a plain set file is enough. + * + * @see \Rector\VersionBonding\Contract\ComposerPackageConstraintInterface + * @see https://github.com/rectorphp/rector-src/pull/8296 */ final readonly class Set implements SetInterface {