Skip to content

Conversation

@nicolas-grekas
Copy link
Member

Q A
Branch? 7.4
Bug fix? no
New feature? yes
Deprecations? no
Issues -
License MIT

#61215 might be too disruptive. This turns the exception into a deprecation.

@nicolas-grekas nicolas-grekas force-pushed the di-class branch 2 times, most recently from 88cb587 to a6912fe Compare July 30, 2025 10:20
@nicolas-grekas nicolas-grekas merged commit 693311f into symfony:7.4 Jul 30, 2025
11 checks passed
@nicolas-grekas nicolas-grekas deleted the di-class branch July 30, 2025 10:25
This was referenced Oct 27, 2025
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants