Skip to content

Commit

Permalink
Be explicit about which Doctrine package in message
Browse files Browse the repository at this point in the history
Avoiding possible confusion while reading the deprecation messages.
  • Loading branch information
lcobucci committed Nov 19, 2019
1 parent ce93817 commit 3314322
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 26 deletions.
6 changes: 3 additions & 3 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Whole Doctrine\ORM\Tools\Export namespace with all its members have been depreca

## Deprecated `Doctrine\ORM\Proxy\Proxy` marker interface

Proxy objects in Doctrine 3.0 will no longer implement `Doctrine\ORM\Proxy\Proxy` nor
Proxy objects in Doctrine ORM 3.0 will no longer implement `Doctrine\ORM\Proxy\Proxy` nor
`Doctrine\Common\Persistence\Proxy`: instead, they implement
`ProxyManager\Proxy\GhostObjectInterface`.

Expand All @@ -57,7 +57,7 @@ These methods have been deprecated:

## Deprecated `Doctrine\ORM\Version`

The `Doctrine\ORM\Version` class is now deprecated and will be removed in Doctrine 3.0:
The `Doctrine\ORM\Version` class is now deprecated and will be removed in Doctrine ORM 3.0:
please refrain from checking the ORM version at runtime or use
[ocramius/package-versions](https://github.com/Ocramius/PackageVersions/).

Expand Down Expand Up @@ -87,7 +87,7 @@ restful operations, you should look at alternatives such as [JMSSerializer](http

## Extending `EntityManager` is deprecated

Final keyword will be added to the `EntityManager::class` in Doctrine 3.0 in order to ensure that EntityManager
Final keyword will be added to the `EntityManager::class` in Doctrine ORM 3.0 in order to ensure that EntityManager
is not used as valid extension point. Valid extension point should be EntityManagerInterface.

## Deprecated `EntityManager#clear($entityName)`
Expand Down
10 changes: 5 additions & 5 deletions lib/Doctrine/ORM/EntityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ public function flush($entity = null)
{
if ($entity !== null) {
@trigger_error(
'Calling ' . __METHOD__ . '() with any arguments to flush specific entities is deprecated and will not be supported in Doctrine 3.0.',
'Calling ' . __METHOD__ . '() with any arguments to flush specific entities is deprecated and will not be supported in Doctrine ORM 3.0.',
E_USER_DEPRECATED
);
}
Expand Down Expand Up @@ -558,7 +558,7 @@ public function clear($entityName = null)

if ($entityName !== null) {
@trigger_error(
'Calling ' . __METHOD__ . '() with any arguments to clear specific entities is deprecated and will not be supported in Doctrine 3.0.',
'Calling ' . __METHOD__ . '() with any arguments to clear specific entities is deprecated and will not be supported in Doctrine ORM 3.0.',
E_USER_DEPRECATED
);
}
Expand Down Expand Up @@ -670,7 +670,7 @@ public function refresh($entity)
*/
public function detach($entity)
{
@trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine 3.0.', E_USER_DEPRECATED);
@trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED);

if ( ! is_object($entity)) {
throw ORMInvalidArgumentException::invalidObject('EntityManager#detach()', $entity);
Expand All @@ -695,7 +695,7 @@ public function detach($entity)
*/
public function merge($entity)
{
@trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine 3.0.', E_USER_DEPRECATED);
@trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED);

if ( ! is_object($entity)) {
throw ORMInvalidArgumentException::invalidObject('EntityManager#merge()', $entity);
Expand All @@ -711,7 +711,7 @@ public function merge($entity)
*/
public function copy($entity, $deep = false)
{
@trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine 3.0.', E_USER_DEPRECATED);
@trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED);

throw new \BadMethodCallException("Not implemented.");
}
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 @@ -48,7 +48,7 @@ class YamlDriver extends FileDriver
public function __construct($locator, $fileExtension = self::DEFAULT_FILE_EXTENSION)
{
@trigger_error(
'YAML mapping driver is deprecated and will be removed in Doctrine 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 annotation or XML driver.',
E_USER_DEPRECATED
);

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function __construct($case = CASE_LOWER, bool $numberAware = false)
{
if (! $numberAware) {
@trigger_error(
'Creating ' . self::class . ' without making it number aware is deprecated and will be removed in Doctrine 3.0.',
'Creating ' . self::class . ' without making it number aware is deprecated and will be removed in Doctrine ORM 3.0.',
E_USER_DEPRECATED
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected function configure()
protected function execute(InputInterface $input, OutputInterface $output)
{
$ui = new SymfonyStyle($input, $output);
$ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine 3.0.');
$ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine ORM 3.0.');

// Process source directories
$fromPaths = array_merge([$input->getArgument('from-path')], $input->getOption('from'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class is supposed to extend which. You have to adjust the entity
protected function execute(InputInterface $input, OutputInterface $output)
{
$ui = new SymfonyStyle($input, $output);
$ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine 3.0.');
$ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine ORM 3.0.');

$em = $this->getHelper('em')->getEntityManager();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ protected function configure()
protected function execute(InputInterface $input, OutputInterface $output)
{
$ui = new SymfonyStyle($input, $output);
$ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine 3.0.');
$ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine ORM 3.0.');

$em = $this->getHelper('em')->getEntityManager();

Expand Down
3 changes: 2 additions & 1 deletion lib/Doctrine/ORM/Tools/EntityGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Doctrine\Common\Inflector\Inflector;
use Doctrine\DBAL\Types\Type;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use const E_USER_DEPRECATED;
use function str_replace;
use function trigger_error;

Expand Down Expand Up @@ -338,7 +339,7 @@ public function __construct(<params>)
*/
public function __construct()
{
@trigger_error(self::class . ' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED);
@trigger_error(self::class . ' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED);

if (version_compare(\Doctrine\Common\Version::VERSION, '2.2.0-DEV', '>=')) {
$this->annotationsPrefix = 'ORM\\';
Expand Down
3 changes: 2 additions & 1 deletion lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
namespace Doctrine\ORM\Tools;

use Doctrine\ORM\EntityRepository;
use const E_USER_DEPRECATED;
use function trigger_error;

/**
Expand Down Expand Up @@ -57,7 +58,7 @@ class <className> extends <repositoryName>

public function __construct()
{
@trigger_error(self::class . ' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED);
@trigger_error(self::class . ' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

namespace Doctrine\ORM\Tools\Export;

use const E_USER_DEPRECATED;
use function trigger_error;

/**
Expand Down Expand Up @@ -46,7 +47,7 @@ class ClassMetadataExporter

public function __construct()
{
@trigger_error(self::class . ' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED);
@trigger_error(self::class . ' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Tools\Export\ExportException;
use const E_USER_DEPRECATED;
use function trigger_error;

/**
Expand Down Expand Up @@ -60,7 +61,7 @@ abstract class AbstractExporter
*/
public function __construct($dir = null)
{
@trigger_error(static::class . ' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED);
@trigger_error(static::class . ' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED);

$this->_outputDir = $dir;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class UnderscoreNamingStrategyTest extends TestCase
/** @test */
public function checkDeprecationMessage() : void
{
$this->expectDeprecationMessage('Creating Doctrine\ORM\Mapping\UnderscoreNamingStrategy without making it number aware is deprecated and will be removed in Doctrine 3.0.');
$this->expectDeprecationMessage('Creating Doctrine\ORM\Mapping\UnderscoreNamingStrategy without making it number aware is deprecated and will be removed in Doctrine ORM 3.0.');
new UnderscoreNamingStrategy(CASE_LOWER, false);
}
}
10 changes: 5 additions & 5 deletions tests/Doctrine/Tests/ORM/EntityManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ public function testDeprecatedClearWithArguments() : void
$entity = new Country(456, 'United Kingdom');
$this->_em->persist($entity);

$this->expectDeprecationMessage('Calling Doctrine\ORM\EntityManager::clear() with any arguments to clear specific entities is deprecated and will not be supported in Doctrine 3.0.');
$this->expectDeprecationMessage('Calling Doctrine\ORM\EntityManager::clear() with any arguments to clear specific entities is deprecated and will not be supported in Doctrine ORM 3.0.');
$this->_em->clear(Country::class);
}

Expand All @@ -323,7 +323,7 @@ public function testDeprecatedFlushWithArguments() : void
$entity = new Country(456, 'United Kingdom');
$this->_em->persist($entity);

$this->expectDeprecationMessage('Calling Doctrine\ORM\EntityManager::flush() with any arguments to flush specific entities is deprecated and will not be supported in Doctrine 3.0.');
$this->expectDeprecationMessage('Calling Doctrine\ORM\EntityManager::flush() with any arguments to flush specific entities is deprecated and will not be supported in Doctrine ORM 3.0.');
$this->_em->flush($entity);
}

Expand All @@ -332,7 +332,7 @@ public function testDeprecatedMerge() : void
$entity = new Country(456, 'United Kingdom');
$this->_em->persist($entity);

$this->expectDeprecationMessage('Method Doctrine\ORM\EntityManager::merge() is deprecated and will be removed in Doctrine 3.0.');
$this->expectDeprecationMessage('Method Doctrine\ORM\EntityManager::merge() is deprecated and will be removed in Doctrine ORM 3.0.');
$this->_em->merge($entity);
}

Expand All @@ -341,7 +341,7 @@ public function testDeprecatedDetach() : void
$entity = new Country(456, 'United Kingdom');
$this->_em->persist($entity);

$this->expectDeprecationMessage('Method Doctrine\ORM\EntityManager::detach() is deprecated and will be removed in Doctrine 3.0.');
$this->expectDeprecationMessage('Method Doctrine\ORM\EntityManager::detach() is deprecated and will be removed in Doctrine ORM 3.0.');
$this->_em->detach($entity);
}

Expand All @@ -351,7 +351,7 @@ public function testDeprecatedCopy() : void
$this->_em->persist($entity);

try {
$this->expectDeprecationMessage('Method Doctrine\ORM\EntityManager::copy() is deprecated and will be removed in Doctrine 3.0.');
$this->expectDeprecationMessage('Method Doctrine\ORM\EntityManager::copy() is deprecated and will be removed in Doctrine ORM 3.0.');
$this->_em->copy($entity);
} catch (\BadMethodCallException $e) {
// do nothing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ protected function getFileExtension()
protected function getDriver(array $paths = [])
{
$driver = new SimplifiedYamlDriver(array_flip($paths));
$this->expectDeprecationMessage('YAML mapping driver is deprecated and will be removed in Doctrine 3.0, please migrate to annotation or XML driver.');
$this->expectDeprecationMessage('YAML mapping driver is deprecated and will be removed in Doctrine ORM 3.0, please migrate to annotation or XML driver.');

return $driver;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function testSpacesShouldBeIgnoredWhenUseExplode()
public function testDeprecation() : void
{
$this->createClassMetadata(DDC2069Entity::class);
$this->expectDeprecationMessage('YAML mapping driver is deprecated and will be removed in Doctrine 3.0, please migrate to annotation or XML driver.');
$this->expectDeprecationMessage('YAML mapping driver is deprecated and will be removed in Doctrine ORM 3.0, please migrate to annotation or XML driver.');
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function testNoMetadataClassesToProcess() : void
]
);

self::assertContains('Command orm:generate-repositories is deprecated and will be removed in Doctrine 3.0.', $tester->getDisplay());
self::assertContains('Command orm:generate-repositories is deprecated and will be removed in Doctrine ORM 3.0.', $tester->getDisplay());
self::assertContains('[OK] No Metadata Classes to process.', $tester->getDisplay());
}
}

0 comments on commit 3314322

Please sign in to comment.