Skip to content

Commit bbb95eb

Browse files
committed
Deprecate doctrine/annotations integration
1 parent 80f1096 commit bbb95eb

File tree

320 files changed

+488
-45
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

320 files changed

+488
-45
lines changed

UPGRADE-6.4.md

Lines changed: 2 additions & 0 deletions

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 1 addition & 0 deletions

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,6 +1716,8 @@ private function registerAnnotationsConfiguration(array $config, ContainerBuilde
17161716
throw new LogicException('Annotations cannot be enabled as the Doctrine Annotation library is not installed. Try running "composer require doctrine/annotations".');
17171717
}
17181718

1719+
trigger_deprecation('symfony/framework-bundle', '6.4', 'Enabling the integration of Doctrine annotations is deprecated. Set the "framework.annotations.enabled" config option to false.');
1720+
17191721
$loader->load('annotations.php');
17201722

17211723
if ('none' === $config['cache']) {

src/Symfony/Bundle/FrameworkBundle/Tests/Command/AboutCommand/Fixture/TestAppKernel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
3434
{
3535
$loader->load(static function (ContainerBuilder $container) {
3636
$container->loadFromExtension('framework', [
37+
'annotations' => false,
3738
'http_method_override' => false,
3839
]);
3940
});

src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@
2525

2626
class CacheClearCommandTest extends TestCase
2727
{
28-
/** @var TestAppKernel */
29-
private $kernel;
30-
/** @var Filesystem */
31-
private $fs;
28+
private TestAppKernel $kernel;
29+
private Filesystem $fs;
3230

3331
protected function setUp(): void
3432
{
@@ -112,7 +110,7 @@ public function testCacheIsWarmedWhenCalledTwice()
112110
$application->setCatchExceptions(false);
113111
$application->doRun($input, new NullOutput());
114112

115-
$this->assertTrue(is_file($this->kernel->getCacheDir().'/annotations.php'));
113+
$this->assertTrue(is_file($this->kernel->getCacheDir().'/dummy.txt'));
116114
}
117115

118116
public function testCacheIsWarmedWithOldContainer()

src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/TestAppKernel.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
1616
use Symfony\Component\Config\Loader\LoaderInterface;
1717
use Symfony\Component\DependencyInjection\ContainerBuilder;
18+
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
1819
use Symfony\Component\HttpKernel\Kernel;
1920

2021
class TestAppKernel extends Kernel
@@ -39,5 +40,22 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
3940
protected function build(ContainerBuilder $container): void
4041
{
4142
$container->register('logger', NullLogger::class);
43+
$container->register(DummyFileCacheWarmer::class)
44+
->addTag('kernel.cache_warmer');
45+
}
46+
}
47+
48+
class DummyFileCacheWarmer implements CacheWarmerInterface
49+
{
50+
public function isOptional(): bool
51+
{
52+
return false;
53+
}
54+
55+
public function warmUp(string $cacheDir): array
56+
{
57+
file_put_contents($cacheDir.'/dummy.txt', 'Hello');
58+
59+
return [];
4260
}
4361
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
framework:
2+
annotations: false
23
http_method_override: false
34
secret: test

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
$container->loadFromExtension('framework', [
4+
'annotations' => false,
45
'http_method_override' => false,
56
'assets' => [
67
'version' => 'SomeVersionScheme',

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets_disabled.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
$container->loadFromExtension('framework', [
4+
'annotations' => false,
45
'http_method_override' => false,
56
'assets' => [
67
'enabled' => false,

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets_version_strategy_as_service.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
$container->loadFromExtension('framework', [
4+
'annotations' => false,
45
'http_method_override' => false,
56
'assets' => [
67
'version_strategy' => 'assets.custom_version_strategy',

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy