Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitef95928

Browse files
nicolas-grekasfabpot
authored andcommitted
[HttpKernel] DeprecateAddAnnotatedClassesToCachePass and related code infrastructure
1 parent7bedfa0 commitef95928

File tree

8 files changed

+33
-4
lines changed

8 files changed

+33
-4
lines changed

‎UPGRADE-7.1.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ PropertyInfo
3737

3838
* Deprecate`PropertyTypeExtractorInterface::getTypes()`, use`PropertyTypeExtractorInterface::getType()` instead
3939

40+
HttpKernel
41+
----------
42+
43+
* Deprecate`Extension::addAnnotatedClassesToCompile()` and related code infrastructure
44+
4045
SecurityBundle
4146
--------------
4247

‎src/Symfony/Component/HttpKernel/CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CHANGELOG
99
* Add`$validationFailedStatusCode` argument to`#[MapQueryParameter]` that allows setting a custom HTTP status code when validation fails
1010
* Add`NearMissValueResolverException` to let value resolvers report when an argument could be under their watch but failed to be resolved
1111
* Add`$type` argument to`#[MapRequestPayload]` that allows mapping a list of items
12+
* Deprecate`Extension::addAnnotatedClassesToCompile()` and related code infrastructure
1213

1314
7.0
1415
---

‎src/Symfony/Component/HttpKernel/DependencyInjection/AddAnnotatedClassesToCachePass.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@
1717
useSymfony\Component\ErrorHandler\DebugClassLoader;
1818
useSymfony\Component\HttpKernel\Kernel;
1919

20+
trigger_deprecation('symfony/http-kernel','7.1','The "%s" class is deprecated since Symfony 7.1 and will be removed in 8.0.', AddAnnotatedClassesToCachePass::class);
21+
2022
/**
2123
* Sets the classes to compile in the cache for the container.
2224
*
2325
* @author Fabien Potencier <fabien@symfony.com>
26+
*
27+
* @deprecated since Symfony 7.1, to be removed in 8.0
2428
*/
2529
class AddAnnotatedClassesToCachePassimplements CompilerPassInterface
2630
{

‎src/Symfony/Component/HttpKernel/DependencyInjection/Extension.php‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* Allow adding classes to the class cache.
1818
*
1919
* @author Fabien Potencier <fabien@symfony.com>
20+
*
21+
* @internal since Symfony 7.1, to be deprecated in 8.1; use Symfony\Component\DependencyInjection\Extension\Extension instead
2022
*/
2123
abstractclass Extensionextends BaseExtension
2224
{
@@ -26,19 +28,27 @@ abstract class Extension extends BaseExtension
2628
* Gets the annotated classes to cache.
2729
*
2830
* @return string[]
31+
*
32+
* @deprecated since Symfony 7.1, to be removed in 8.0
2933
*/
3034
publicfunctiongetAnnotatedClassesToCompile():array
3135
{
36+
trigger_deprecation('symfony/http-kernel','7.1','The "%s()" method is deprecated since Symfony 7.1 and will be removed in 8.0.',__METHOD__);
37+
3238
return$this->annotatedClasses;
3339
}
3440

3541
/**
3642
* Adds annotated classes to the class cache.
3743
*
3844
* @param string[] $annotatedClasses An array of class patterns
45+
*
46+
* @deprecated since Symfony 7.1, to be removed in 8.0
3947
*/
4048
publicfunctionaddAnnotatedClassesToCompile(array$annotatedClasses):void
4149
{
50+
trigger_deprecation('symfony/http-kernel','7.1','The "%s()" method is deprecated since Symfony 7.1 and will be removed in 8.0.',__METHOD__);
51+
4252
$this->annotatedClasses =array_merge($this->annotatedClasses,$annotatedClasses);
4353
}
4454
}

‎src/Symfony/Component/HttpKernel/Kernel.php‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
useSymfony\Component\HttpKernel\Bundle\BundleInterface;
3838
useSymfony\Component\HttpKernel\CacheWarmer\WarmableInterface;
3939
useSymfony\Component\HttpKernel\Config\FileLocator;
40-
useSymfony\Component\HttpKernel\DependencyInjection\AddAnnotatedClassesToCachePass;
4140
useSymfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
4241

4342
// Help opcache.preload discover always-needed symbols
@@ -278,9 +277,13 @@ public function getContainer(): ContainerInterface
278277

279278
/**
280279
* @internal
280+
*
281+
* @deprecated since Symfony 7.1, to be removed in 8.0
281282
*/
282283
publicfunctionsetAnnotatedClassCache(array$annotatedClasses):void
283284
{
285+
trigger_deprecation('symfony/http-kernel','7.1','The "%s()" method is deprecated since Symfony 7.1 and will be removed in 8.0.',__METHOD__);
286+
284287
file_put_contents(($this->warmupDir ?:$this->getBuildDir()).'/annotations.map',sprintf('<?php return %s;',var_export($annotatedClasses,true)));
285288
}
286289

@@ -314,9 +317,13 @@ public function getCharset(): string
314317
* Gets the patterns defining the classes to parse and cache for annotations.
315318
*
316319
* @return string[]
320+
*
321+
* @deprecated since Symfony 7.1, to be removed in 8.0
317322
*/
318323
publicfunctiongetAnnotatedClassesToCompile():array
319324
{
325+
trigger_deprecation('symfony/http-kernel','7.1','The "%s()" method is deprecated since Symfony 7.1 and will be removed in 8.0.',__METHOD__);
326+
320327
return [];
321328
}
322329

@@ -591,8 +598,6 @@ protected function buildContainer(): ContainerBuilder
591598
$this->prepareContainer($container);
592599
$this->registerContainerConfiguration($this->getContainerLoader($container));
593600

594-
$container->addCompilerPass(newAddAnnotatedClassesToCachePass($this));
595-
596601
return$container;
597602
}
598603

‎src/Symfony/Component/HttpKernel/Tests/DependencyInjection/AddAnnotatedClassesToCachePassTest.php‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
usePHPUnit\Framework\TestCase;
1515
useSymfony\Component\HttpKernel\DependencyInjection\AddAnnotatedClassesToCachePass;
1616

17+
/**
18+
* @group legacy
19+
*/
1720
class AddAnnotatedClassesToCachePassTestextends TestCase
1821
{
1922
publicfunctiontestExpandClasses()

‎src/Symfony/Component/HttpKernel/Tests/DependencyInjection/MergeExtensionConfigurationPassTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
usePHPUnit\Framework\TestCase;
1515
useSymfony\Component\DependencyInjection\ContainerBuilder;
16+
useSymfony\Component\DependencyInjection\Extension\Extension;
1617
useSymfony\Component\DependencyInjection\ParameterBag\ParameterBag;
17-
useSymfony\Component\HttpKernel\DependencyInjection\Extension;
1818
useSymfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
1919
useSymfony\Component\HttpKernel\Tests\Fixtures\AcmeFooBundle\AcmeFooBundle;
2020

‎src/Symfony/Component/HttpKernel/composer.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
],
1818
"require": {
1919
"php":">=8.2",
20+
"symfony/deprecation-contracts":"^2.5|^3",
2021
"symfony/error-handler":"^6.4|^7.0",
2122
"symfony/event-dispatcher":"^6.4|^7.0",
2223
"symfony/http-foundation":"^6.4|^7.0",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp