8000 Deprecate doctrine/annotations integration · symfony/symfony@bbb95eb · GitHub
[go: up one dir, main page]

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',

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache.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
'cache' => [
67
'pools' => [

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache_app_redis_tag_aware.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
'cache' => [
67
'app' => 'cache.adapter.redis_tag_aware',

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache_app_redis_tag_aware_pool.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
'cache' => [
67
'app' => 'cache.redis_tag_aware.foo',

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/csrf.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
'csrf_protection' => true,
67
'session' => [

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/csrf_needs_session.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
'csrf_protection' => [
67
'enabled' => true,
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
22

33
$container->loadFromExtension('framework', [
4-
'http_method_override' => false,]);
4+
'annotations' => false,
5+
'http_method_override' => false,
6+
]);

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/esi_and_ssi_without_fragments.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
'fragments' => [
67
'enabled' => false,

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/esi_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
'esi' => [
67
'enabled' => false,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException;
77

88
$container->loadFromExtension('framework', [
9+
'annotations' => false,
910
'http_method_override' => false,
1011
'exceptions' => [
1112
BadRequestHttpException::class => [

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/form_csrf_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
'csrf_protection' => false,
56
'form' => [
67
'csrf_protection' => true,

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/form_default_csrf.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
'session' => [
67
'storage_factory_id' => 'session.storage.factory.native',

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/form_no_csrf.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
'form' => [
67
'csrf_protection' => [

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/fragments_and_hinclude.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
'fragments' => [
67
'enabled' => true,

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@
5757
'enabled' => true,
5858
],
5959
'annotations' => [
60-
'cache' => 'file',
61-
'debug' => true,
62-
'file_cache_dir' => '%kernel.cache_dir%/annotations',
60+
'enabled' => false,
6361
],
6462
'serializer' => [
6563
'enabled' => true,

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/html_sanitizer.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
'html_sanitizer' => [
67
'sanitizers' => [

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/html_sanitizer_default_allowed_link_and_media_hosts.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
'html_sanitizer' => [
67
'sanitizers' => [
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

33
$container->loadFromExtension('framework', [
4+
'annotations' => false,
45
'http_method_override' => false,
56
'html_sanitizer' => null]);

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/http_client_default_options.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
'http_client' => [
67
'max_host_connections' => 4,

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/http_client_full_default_options.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
'http_client' => [
67
'default_options' => [

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/http_client_mock_response_factory.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
'http_client' => [
67
'default_options' => null,

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/http_client_override_default_options.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
'http_client' => [
67
'max_host_connections' => 4,

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/http_client_retry.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
'http_client' => [
67
'default_options' => [

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/http_client_scoped_without_query_option.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
'http_client' => [
67
'scoped_clients' => [

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/http_client_xml_key.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
'http_client' => [
67
'default_options' => [
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
$container->loadFromExtension('framework', [
4+
'annotations' => [
5+
'cache' => 'file',
6+
'debug' => true,
7+
'file_cache_dir' => '%kernel.cache_dir%/annotations',
8+
],
9+
'http_method_override' => false,
10+
]);

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/legacy_translator_enabled_locales.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
'secret' => 's3cr3t',
67
'default_locale' => 'fr',

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/mailer.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
'mailer' => [
67
'dsn' => 'smtp://example.com',

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/mailer_with_disabled_message_bus.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
'mailer' => [
67
'dsn' => 'smtp://example.com',

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
return static function (ContainerConfigurator $container) {
66
$container->extension('framework', [
7+
'annotations' => false,
78
'http_method_override' => false,
89
'mailer' => [
910
'dsn' => 'smtp://example.com',

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/mailer_with_specific_message_bus.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
'mailer' => [
67
'dsn' => 'smtp://example.com',

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
return static function (ContainerConfigurator $container) {
66
$container->extension('framework', [
7+
'annotations' => false,
78
'http_method_override' => false,
89
'mailer' => [
910
'transports' => [

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\FooMessage;
55

66
$container->loadFromExtension('framework', [
7+
'annotations' => false,
78
'http_method_override' => false,
89
'scheduler' => true,
910
'messenger' => [

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/messenger_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
'messenger' => false,
67
'scheduler' => false,

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/messenger_middleware_factory_erroneous_format.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
'messenger' => [
67
'buses' => [

0 commit comments

Comments
 (0)
0