Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c0e9ee1

Browse filesBrowse files
derrabusnicolas-grekas
authored andcommitted
Remove calls to AnnotationRegistry::registerLoader()
1 parent b23a087 commit c0e9ee1
Copy full SHA for c0e9ee1

File tree

Expand file treeCollapse file tree

9 files changed

+8
-48
lines changed
Filter options
Expand file treeCollapse file tree

9 files changed

+8
-48
lines changed

‎composer.json

Copy file name to clipboardExpand all lines: composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
"doctrine/collections": "^1.0|^2.0",
129129
"doctrine/data-fixtures": "^1.1",
130130
"doctrine/dbal": "^2.13.1|^3.0",
131-
"doctrine/orm": "^2.7.4",
131+
"doctrine/orm": "^2.12",
132132
"egulias/email-validator": "^2.1.10|^3.1",
133133
"guzzlehttp/promises": "^1.4",
134134
"league/html-to-markdown": "^5.0",

‎src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Doctrine\ORM\EntityManager;
1717
use Doctrine\ORM\Mapping\Column;
1818
use Doctrine\ORM\ORMSetup;
19-
use Doctrine\ORM\Tools\Setup;
2019
use PHPUnit\Framework\TestCase;
2120
use Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor;
2221
use Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineDummy;
@@ -34,9 +33,7 @@ class DoctrineExtractorTest extends TestCase
3433
{
3534
private function createExtractor()
3635
{
37-
$config = class_exists(ORMSetup::class)
38-
? ORMSetup::createAnnotationMetadataConfiguration([__DIR__.\DIRECTORY_SEPARATOR.'Fixtures'], true)
39-
: Setup::createAnnotationMetadataConfiguration([__DIR__.\DIRECTORY_SEPARATOR.'Fixtures'], true);
36+
$config = ORMSetup::createAnnotationMetadataConfiguration([__DIR__.\DIRECTORY_SEPARATOR.'Fixtures'], true);
4037
$entityManager = EntityManager::create(['driver' => 'pdo_sqlite'], $config);
4138

4239
if (!DBALType::hasType('foo')) {

‎src/Symfony/Bridge/Doctrine/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/composer.json
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,18 @@
4242
"symfony/validator": "^5.4|^6.0",
4343
"symfony/translation": "^5.4|^6.0",
4444
"symfony/var-dumper": "^5.4|^6.0",
45-
"doctrine/annotations": "^1.10.4|^2",
45+
"doctrine/annotations": "^1.13.1|^2",
4646
"doctrine/collections": "^1.0|^2.0",
4747
"doctrine/data-fixtures": "^1.1",
4848
"doctrine/dbal": "^2.13.1|^3.0",
49-
"doctrine/orm": "^2.7.4",
49+
"doctrine/orm": "^2.12",
5050
"psr/log": "^1|^2|^3"
5151
},
5252
"conflict": {
53+
"doctrine/annotations": "<1.13.1",
5354
"doctrine/dbal": "<2.13.1",
5455
"doctrine/lexer": "<1.1",
55-
"doctrine/orm": "<2.7.4",
56+
"doctrine/orm": "<2.12",
5657
"phpunit/phpunit": "<5.4.3",
5758
"symfony/cache": "<5.4",
5859
"symfony/dependency-injection": "<6.2",

‎src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php
-9Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Bridge\PhpUnit\Legacy;
1313

14-
use Doctrine\Common\Annotations\AnnotationRegistry;
1514
use PHPUnit\Framework\AssertionFailedError;
1615
use PHPUnit\Framework\RiskyTestError;
1716
use PHPUnit\Framework\TestCase;
@@ -130,14 +129,6 @@ public function startTestSuite($suite)
130129
echo "Testing $suiteName\n";
131130
$this->state = 0;
132131

133-
if (!class_exists(AnnotationRegistry::class, false) && class_exists(AnnotationRegistry::class)) {
134-
if (method_exists(AnnotationRegistry::class, 'registerUniqueLoader')) {
135-
AnnotationRegistry::registerUniqueLoader('class_exists');
136-
} elseif (method_exists(AnnotationRegistry::class, 'registerLoader')) {
137-
AnnotationRegistry::registerLoader('class_exists');
138-
}
139-
}
140-
141132
if ($this->skippedFile = getenv('SYMFONY_PHPUNIT_SKIPPED_TESTS')) {
142133
$this->state = 1;
143134

‎src/Symfony/Bridge/PhpUnit/bootstrap.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/bootstrap.php
-9Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
use Doctrine\Common\Annotations\AnnotationRegistry;
1312
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler;
1413

1514
// Detect if we need to serialize deprecations to a file.
@@ -27,14 +26,6 @@
2726
// Enforce a consistent locale
2827
setlocale(\LC_ALL, 'C');
2928

30-
if (!class_exists(AnnotationRegistry::class, false) && class_exists(AnnotationRegistry::class)) {
31-
if (method_exists(AnnotationRegistry::class, 'registerUniqueLoader')) {
32-
AnnotationRegistry::registerUniqueLoader('class_exists');
33-
} elseif (method_exists(AnnotationRegistry::class, 'registerLoader')) {
34-
AnnotationRegistry::registerLoader('class_exists');
35-
}
36-
}
37-
3829
if ('disabled' !== getenv('SYMFONY_DEPRECATIONS_HELPER')) {
3930
DeprecationErrorHandler::register(getenv('SYMFONY_DEPRECATIONS_HELPER'));
4031
}

‎src/Symfony/Bridge/PhpUnit/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/composer.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"symfony/error-handler": "For tracking deprecated interfaces usages at runtime with DebugClassLoader"
2929
},
3030
"conflict": {
31+
"doctrine/annotations": "<1.10",
3132
"phpunit/phpunit": "<7.5|9.1.2"
3233
},
3334
"autoload": {

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
-10Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection;
1313

1414
use Composer\InstalledVersions;
15-
use Doctrine\Common\Annotations\AnnotationRegistry;
1615
use Doctrine\Common\Annotations\Reader;
1716
use Http\Client\HttpClient;
1817
use phpDocumentor\Reflection\DocBlockFactoryInterface;
@@ -1643,15 +1642,6 @@ private function registerAnnotationsConfiguration(array $config, ContainerBuilde
16431642

16441643
$loader->load('annotations.php');
16451644

1646-
if (!method_exists(AnnotationRegistry::class, 'registerUniqueLoader')) {
1647-
if (method_exists(AnnotationRegistry::class, 'registerLoader')) {
1648-
$container->getDefinition('annotations.dummy_registry')
1649-
->setMethodCalls([['registerLoader', ['class_exists']]]);
1650-
} else {
1651-
$container->removeDefinition('annotations.dummy_registry');
1652-
}
1653-
}
1654-
16551645
if ('none' === $config['cache']) {
16561646
$container->removeDefinition('annotations.cached_reader');
16571647

‎src/Symfony/Bundle/FrameworkBundle/Resources/config/annotations.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/annotations.php
+1-8Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
1313

1414
use Doctrine\Common\Annotations\AnnotationReader;
15-
use Doctrine\Common\Annotations\AnnotationRegistry;
1615
use Doctrine\Common\Annotations\PsrCachedReader;
1716
use Doctrine\Common\Annotations\Reader;
1817
use Symfony\Bundle\FrameworkBundle\CacheWarmer\AnnotationsCacheWarmer;
@@ -23,13 +22,7 @@
2322
return static function (ContainerConfigurator $container) {
2423
$container->services()
2524
->set('annotations.reader', AnnotationReader::class)
26-
->call('addGlobalIgnoredName', [
27-
'required',
28-
service('annotations.dummy_registry')->ignoreOnInvalid(), // dummy arg to register class_exists as annotation loader only when required
29-
])
30-
31-
->set('annotations.dummy_registry', AnnotationRegistry::class)
32-
->call('registerUniqueLoader', ['class_exists'])
25+
->call('addGlobalIgnoredName', ['required'])
3326

3427
->set('annotations.cached_reader', PsrCachedReader::class)
3528
->args([

‎src/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderWithAnnotationsTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderWithAnnotationsTest.php
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Routing\Tests\Loader;
1313

1414
use Doctrine\Common\Annotations\AnnotationReader;
15-
use Doctrine\Common\Annotations\AnnotationRegistry;
1615
use Symfony\Component\Routing\Loader\AnnotationClassLoader;
1716
use Symfony\Component\Routing\Route;
1817

@@ -26,9 +25,6 @@ protected function configureRoute(Route $route, \ReflectionClass $class, \Reflec
2625
{
2726
}
2827
};
29-
if (method_exists(AnnotationRegistry::class, 'registerLoader')) {
30-
AnnotationRegistry::registerLoader('class_exists');
31-
}
3228
}
3329

3430
public function testDefaultRouteName()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.