You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the suggestion in the deprecation notice about which class name to use for 'catch' does not actually work.
Current behavior
Changing catches to Doctrine\ORM\Exception\ORMException per the deprecation notice causes the catches to be ignored.
How to reproduce
<?phprequire'vendor/autoload.php';
try {
throw \Doctrine\ORM\Exception\ORMException::namedQueryNotFound('demo');
} catch (\Doctrine\ORM\Exception\ORMException$ex) {
// This is what we are told to change to based on:// Note in: src/ORMException.php// @deprecated Use Doctrine\ORM\Exception\ORMException for catch and instanceofecho "The suggested catch caught\n";
}
Expected behavior
output: The suggested catch caught
Actual behavior
Fatal error: Uncaught Doctrine\ORM\ORMException: Could not find a named query by the name "demo" in /tmp/d/vendor/doctrine/orm/src/ORMException.php:42
Stack trace:
#0 Standard input code(6): Doctrine\ORM\ORMException::namedQueryNotFound()
#1 {main}
thrown in /tmp/d/vendor/doctrine/orm/src/ORMException.php on line 42
The text was updated successfully, but these errors were encountered:
rrehbein
changed the title
Deprecation annotation gives a broken suggestion of what to change
Doctrine 2: Deprecation annotation gives a broken suggestion of what to change
Feb 9, 2024
Bug Report
Summary
Following the suggestion in the deprecation notice about which class name to use for 'catch' does not actually work.
Current behavior
Changing catches to
Doctrine\ORM\Exception\ORMException
per the deprecation notice causes the catches to be ignored.How to reproduce
Expected behavior
output:
The suggested catch caught
Actual behavior
The text was updated successfully, but these errors were encountered: