Skip to content

Commit

Permalink
Add missing deprecations for YAML metadata mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed Nov 28, 2021
1 parent 2488b4c commit cf73778
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Doctrine/ORM/Mapping/Driver/SimplifiedYamlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

/**
* YamlDriver that additionally looks for mapping information in a global file.
*
* @deprecated This class is being removed from the ORM and won't have any replacement
*/
class SimplifiedYamlDriver extends YamlDriver
{
Expand Down
9 changes: 9 additions & 0 deletions lib/Doctrine/ORM/Tools/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Doctrine\Common\Cache\Psr6\DoctrineProvider;
use Doctrine\Common\Cache\RedisCache;
use Doctrine\Common\ClassLoader;
use Doctrine\Deprecations\Deprecation;
use Doctrine\ORM\Configuration;
use Doctrine\ORM\Mapping\Driver\AttributeDriver;
use Doctrine\ORM\Mapping\Driver\XmlDriver;
Expand Down Expand Up @@ -113,6 +114,8 @@ public static function createXMLMetadataConfiguration(array $paths, $isDevMode =
/**
* Creates a configuration with a yaml metadata driver.
*
* @deprecated YAML metadata mapping is deprecated and will be removed in 3.0
*
* @param mixed[] $paths
* @param bool $isDevMode
* @param string $proxyDir
Expand All @@ -121,6 +124,12 @@ public static function createXMLMetadataConfiguration(array $paths, $isDevMode =
*/
public static function createYAMLMetadataConfiguration(array $paths, $isDevMode = false, $proxyDir = null, ?Cache $cache = null)
{
Deprecation::trigger(
'doctrine/orm',
'https://github.com/doctrine/orm/issues/8465',
'YAML mapping driver is deprecated and will be removed in Doctrine ORM 3.0, please migrate to annotation or XML driver.'
);

$config = self::createConfiguration($isDevMode, $proxyDir, $cache);
$config->setMetadataDriverImpl(new YamlDriver($paths));

Expand Down

0 comments on commit cf73778

Please sign in to comment.