Skip to content

Commit

Permalink
[doctrineGH-9277] Deprecate PHPDriver
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed Jan 1, 2022
1 parent 133cc95 commit bd0cc8b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/en/reference/php-mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ the code in PHP files or inside of a static function named
PHP Files
---------

.. note::

PHPDriver is deprecated and will be removed in 3.0, use StaticPHPDriver
instead.

If you wish to write your mapping information inside PHP files that
are named after the entity and included to populate the metadata
for an entity you can do so by using the ``PHPDriver``:
Expand Down
16 changes: 15 additions & 1 deletion lib/Doctrine/ORM/Mapping/Driver/PHPDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,27 @@

namespace Doctrine\ORM\Mapping\Driver;

use Doctrine\Deprecations\Deprecation;
use Doctrine\Persistence\Mapping\Driver\PHPDriver as CommonPHPDriver;

/**
* {@inheritDoc}
*
* @deprecated this driver will be removed. Use Doctrine\Persistence\Mapping\Driver\PHPDriver instead
* @deprecated this driver will be removed, use StaticPHPDriver or other mapping drivers instead.
*/
class PHPDriver extends CommonPHPDriver
{
/**
* {@inheritDoc}
*/
public function __construct($locator)
{
Deprecation::trigger(
'doctrine/orm',
'https://github.com/doctrine/orm/issues/9277',
'PHPDriver is deprecated, use StaticPHPDriver or other mapping drivers instead.'
);

parent::__construct($locator, '.php');
}
}

0 comments on commit bd0cc8b

Please sign in to comment.