Skip to content

Commit

Permalink
Add missing deprecations for YAML metadata mapping (#9206)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed Nov 29, 2021
1 parent 5e8b34a commit 6857a2e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct($locator, $fileExtension = self::DEFAULT_FILE_EXTENS
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.'
'YAML mapping driver is deprecated and will be removed in Doctrine ORM 3.0, please migrate to attribute or XML driver.'
);

parent::__construct($locator, $fileExtension);
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 attribute or XML driver.'
);

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

Expand Down

0 comments on commit 6857a2e

Please sign in to comment.