-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[DependencyInjection] Deprecate registering a service without a class when its id is a non-existing FQCN #61270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xabbuh
reviewed
Jul 30, 2025
src/Symfony/Component/DependencyInjection/Compiler/ResolveClassPass.php
Outdated
Show resolved
Hide resolved
88cb587 to
a6912fe
Compare
… when its id is a non-existing FQCN
This was referenced Oct 27, 2025
Merged
Merged
bnf
added a commit
to bnf/symfony
that referenced
this pull request
Nov 28, 2025
… PHP error The `class_exists` check and the condition `$definition instanceof ChildDefinition` have been swapped with symfony#61215 in order to produce an error if a service is not available. This error was later relaxed in symfony#61270, but the executing order of the condition kept to be `class_exists` first, then `instanceof`. That means, if `class_exists` fails with a PHP error (like PHP Fatal Error: Interface "My\Vendor\MyInterface" not found`) affected uses will not see the deprecation, but a fatal error instead. TODO: * Add tests * Add an issue (see https://forge.typo3.org/issues/108349 for reference)
bnf
added a commit
to bnf/symfony
that referenced
this pull request
Nov 28, 2025
… PHP error The `class_exists` check and the condition `$definition instanceof ChildDefinition` have been swapped with symfony#61215 in order to produce an error if a service is not available. This error was later relaxed to a deprecation in symfony#61270, but the executing order of the condition kept to be `class_exists` first, then `instanceof`. That means, if `class_exists` fails with a PHP error (like PHP Fatal Error: Interface "My\Vendor\MyInterface" not found`) affected uses will not receive the deprecation, but a fatal error instead.
bnf
added a commit
to bnf/symfony
that referenced
this pull request
Nov 28, 2025
… PHP error The `class_exists` check and the condition `$definition instanceof ChildDefinition` have been swapped with symfony#61215 in order to produce an error if a service is not available. This error was later relaxed to a deprecation in symfony#61270, but the executing order of the condition kept to be `class_exists` first, then `instanceof`. That means, if `class_exists` fails with a PHP error (like PHP Fatal Error: Interface "My\Vendor\MyInterface" not found`) affected uses will not receive the deprecation, but a fatal error instead.
bnf
added a commit
to bnf/symfony
that referenced
this pull request
Nov 28, 2025
… PHP error The `class_exists` check and the condition `$definition instanceof ChildDefinition` have been swapped with symfony#61215 in order to produce an error if a service is not available. This error was later relaxed to a deprecation in symfony#61270, but the executing order of the condition kept to be `class_exists` first, then `instanceof`. That means, if `class_exists` fails with a PHP error (like PHP Fatal Error: Interface "My\Vendor\MyInterface" not found`) affected uses will not receive the deprecation, but a fatal error instead.
bnf
added a commit
to bnf/symfony
that referenced
this pull request
Nov 28, 2025
… PHP error The `class_exists` check and the condition `$definition instanceof ChildDefinition` have been swapped with symfony#61215 in order to produce an error if a service is not available. This error was later relaxed to a deprecation in symfony#61270, but the executing order of the condition kept to be `class_exists` first, then `instanceof`. That means, if `class_exists` fails with a PHP error (like PHP Fatal Error: Interface "My\Vendor\MyInterface" not found`) affected uses will not receive the deprecation, but a fatal error instead.
bnf
added a commit
to bnf/symfony
that referenced
this pull request
Nov 28, 2025
… PHP error The `class_exists` check and the condition `$definition instanceof ChildDefinition` have been swapped with symfony#61215 in order to produce an error if a service is not available. This error was later relaxed to a deprecation in symfony#61270, but the executing order of the condition kept to be `class_exists` first, then `instanceof`. That means, if `class_exists` fails with a PHP error (like PHP Fatal Error: Interface "My\Vendor\MyInterface" not found`) affected uses will not receive the deprecation, but a fatal error instead.
bnf
added a commit
to bnf/symfony
that referenced
this pull request
Nov 28, 2025
… PHP error The `class_exists` check and the condition `$definition instanceof ChildDefinition` have been swapped with symfony#61215 in order to produce an error if a service is not available. This error was later relaxed to a deprecation in symfony#61270, but the executing order of the condition kept to be `class_exists` first, then `instanceof`. That means, if `class_exists` fails with a PHP error (like PHP Fatal Error: Interface "My\Vendor\MyInterface" not found`) affected uses will not receive the deprecation, but a fatal error instead.
bnf
added a commit
to bnf/symfony
that referenced
this pull request
Nov 28, 2025
… PHP error The `class_exists` check and the condition `$definition instanceof ChildDefinition` have been swapped with symfony#61215 in order to produce an error if a service is not available. This error was later relaxed to a deprecation in symfony#61270, but the executing order of the condition kept to be `class_exists` first, then `instanceof`. That means, if `class_exists` fails with a PHP error (like PHP Fatal Error: Interface "My\Vendor\MyInterface" not found`) affected uses will not receive the deprecation, but a fatal error instead.
bnf
added a commit
to bnf/symfony
that referenced
this pull request
Nov 28, 2025
… PHP error The `class_exists` check and the condition `$definition instanceof ChildDefinition` have been swapped with symfony#61215 in order to produce an error if a service is not available. This error was later relaxed to a deprecation in symfony#61270, but the executing order of the condition kept to be `class_exists` first, then `instanceof`. That means, if `class_exists` fails with a PHP error (like PHP Fatal Error: Interface "My\Vendor\MyInterface" not found`) affected uses will not receive the deprecation, but a fatal error instead.
bnf
added a commit
to bnf/symfony
that referenced
this pull request
Dec 1, 2025
… PHP error The `class_exists` check and the condition `$definition instanceof ChildDefinition` have been swapped with symfony#61215 in order to produce an error if a service is not available. This error was later relaxed to a deprecation in symfony#61270, but the executing order of the condition kept to be `class_exists` first, then `instanceof`. That means, if `class_exists` fails with a PHP error (like PHP Fatal Error: Interface "My\Vendor\MyInterface" not found`) affected uses will not receive the deprecation, but a fatal error instead.
nicolas-grekas
pushed a commit
to bnf/symfony
that referenced
this pull request
Dec 4, 2025
… PHP error The `class_exists` check and the condition `$definition instanceof ChildDefinition` have been swapped with symfony#61215 in order to produce an error if a service is not available. This error was later relaxed to a deprecation in symfony#61270, but the executing order of the condition kept to be `class_exists` first, then `instanceof`. That means, if `class_exists` fails with a PHP error (like PHP Fatal Error: Interface "My\Vendor\MyInterface" not found`) affected uses will not receive the deprecation, but a fatal error instead.
nicolas-grekas
added a commit
that referenced
this pull request
Dec 4, 2025
…t trigger a PHP error (bnf) This PR was merged into the 7.4 branch. Discussion ---------- [DependencyInjection] Ensure deprecation detection does not trigger a PHP error `Exception Interface "TYPO3\CMS\Reports\StatusProviderInterface" not found` See https://forge.typo3.org/issues/108349 | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #62589 | License | MIT The `class_exists` check and the condition `$definition instanceof ChildDefinition` have been swapped with #61215 in order to produce an error if a service is not available. This error was later relaxed in #61270, but the executing order of the condition kept to be `class_exists` first, then `instanceof`. That means, if `class_exists` fails with a PHP error (like PHP Fatal Error: Interface "My\Vendor\MyInterface" not found`) affected uses will not see the deprecation, but a fatal error instead. Commits ------- 662d28f [DependencyInjection] Ensure deprecation detection does not trigger a PHP error
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#61215 might be too disruptive. This turns the exception into a deprecation.