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 1570f65
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 23 deletions.
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
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Tools/EntityGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,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
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,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
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,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
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,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 1570f65

Please sign in to comment.