Skip to content

Proposal: Create exceptions DowngradeNotImplementedException and DowngradeNotPossibleException #4316

Description

@leoloso

Feature Request

There are features from new PHP version that cannot be downgraded to a previous version, such as #4317, so we could throw DowngradeNotPossibleException whenever finding these features in the code.

There could also be features that can be downgraded, but we haven't done it yet (eg: because we disregarded that use case).

For instance, the downgrade rule from #4314 may be applied to a still-unsupported use case. Then, the rule could fail with throwing DowngradeNotImplementedException, and showing an error message asking the developer to add an issue for this new use case in the Rector repo.

If after analyzing the use case, we come to the conclusion that it cannot be downgraded, then we could throw a DowngradeNotPossibleException, explaining why this feature cannot be supported by previous PHP versions. This may well happen with annotations from PHP 8.0 (#4156)

Several exceptions could happen in a single run, so we could extract the message from all of them and show them all together once the run has ended.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions