Skip to content
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

Trigger deprecation in AnnotationDriver only if PHP >= 8.0 #10760

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
use function is_array;
use function is_numeric;

use const PHP_VERSION_ID;

/**
* The AnnotationDriver reads the mapping metadata from docblock annotations.
*/
Expand Down Expand Up @@ -62,11 +64,14 @@ class AnnotationDriver extends CompatibilityAnnotationDriver
*/
public function __construct($reader, $paths = null)
{
Deprecation::trigger(
'doctrine/orm',
'https://github.com/doctrine/orm/issues/10098',
'The annotation mapping driver is deprecated and will be removed in Doctrine ORM 3.0, please migrate to the attribute or XML driver.'
);
if (PHP_VERSION_ID >= 80000) {
Deprecation::trigger(
'doctrine/orm',
'https://github.com/doctrine/orm/issues/10098',
'The annotation mapping driver is deprecated and will be removed in Doctrine ORM 3.0, please migrate to the attribute or XML driver.'
);
}

$this->reader = $reader;

$this->addPaths((array) $paths);
Expand Down