Skip to content

Commit a1cdb47

Browse files
committed
mark classes implementing the WarmableInterface as final
1 parent 0f46e33 commit a1cdb47

File tree

16 files changed

+57
-18
lines changed

16 files changed

+57
-18
lines changed

UPGRADE-7.1.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,31 @@ Cache
66

77
* Deprecate `CouchbaseBucketAdapter`, use `CouchbaseCollectionAdapter` instead
88

9+
FrameworkBundle
10+
---------------
11+
12+
* Mark classes `ConfigBuilderCacheWarmer`, `Router`, `SerializerCacheWarmer`, `TranslationsCacheWarmer`, `Translator` and `ValidatorCacheWarmer` as `final`
13+
914
Messenger
1015
---------
1116

1217
* Make `#[AsMessageHandler]` final
1318

19+
SecurityBundle
20+
--------------
21+
22+
* Mark class `ExpressionCacheWarmer` as `final`
23+
24+
Translation
25+
-----------
26+
27+
* Mark class `DataCollectorTranslator` as `final`
28+
29+
TwigBundle
30+
----------
31+
32+
* Mark class `TemplateCacheWarmer` as `final`
33+
1434
Workflow
1535
--------
1636

src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
* since this information is necessary to build the proxies in the first place.
2222
*
2323
* @author Benjamin Eberlei <[email protected]>
24+
*
25+
* @final since Symfony 7.1
2426
*/
2527
class ProxyCacheWarmer implements CacheWarmerInterface
2628
{

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

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

7+
* Mark classes `ConfigBuilderCacheWarmer`, `Router`, `SerializerCacheWarmer`, `TranslationsCacheWarmer`, `Translator` and `ValidatorCacheWarmer` as `final`
78
* Move the Router `cache_dir` to `kernel.build_dir`
89
* Deprecate the `router.cache_dir` config option
910
* Add `rate_limiter` tags to rate limiter services

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ConfigBuilderCacheWarmer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
* Generate all config builders.
2626
*
2727
* @author Tobias Nyholm <[email protected]>
28+
*
29+
* @final since Symfony 7.1
2830
*/
2931
class ConfigBuilderCacheWarmer implements CacheWarmerInterface
3032
{

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/SerializerCacheWarmer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
* Warms up XML and YAML serializer metadata.
2424
*
2525
* @author Titouan Galopin <[email protected]>
26+
*
27+
* @final since Symfony 7.1
2628
*/
2729
class SerializerCacheWarmer extends AbstractPhpFileCacheWarmer
2830
{

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TranslationsCacheWarmer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
* Generates the catalogues for translations.
2222
*
2323
* @author Xavier Leune <[email protected]>
24+
*
25+
* @final since Symfony 7.1
2426
*/
2527
class TranslationsCacheWarmer implements CacheWarmerInterface, ServiceSubscriberInterface
2628
{

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ValidatorCacheWarmer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
* Warms up XML and YAML validator metadata.
2525
*
2626
* @author Titouan Galopin <[email protected]>
27+
*
28+
* @final since Symfony 7.1
2729
*/
2830
class ValidatorCacheWarmer extends AbstractPhpFileCacheWarmer
2931
{

src/Symfony/Bundle/FrameworkBundle/Routing/Router.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
* This Router creates the Loader only when the cache is empty.
3131
*
3232
* @author Fabien Potencier <[email protected]>
33+
*
34+
* @final since Symfony 7.1
3335
*/
3436
class Router extends BaseRouter implements WarmableInterface, ServiceSubscriberInterface
3537
{

src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,6 @@ public function testTransWithCaching()
100100
$this->assertEquals('foobarbax (sr@latin)', $translator->trans('foobarbax'));
101101
}
102102

103-
public function testTransWithCachingWithInvalidLocale()
104-
{
105-
$this->expectException(\InvalidArgumentException::class);
106-
$this->expectExceptionMessage('Invalid "invalid locale" locale.');
107-
$loader = $this->createMock(LoaderInterface::class);
108-
$translator = $this->getTranslator($loader, ['cache_dir' => $this->tmpDir], 'loader', TranslatorWithInvalidLocale::class);
109-
110-
$translator->trans('foo');
111-
}
112-
113103
public function testLoadResourcesWithoutCaching()
114104
{
115105
$loader = new YamlFileLoader();
@@ -418,11 +408,3 @@ private function createTranslator($loader, $options, $translatorClass = Translat
418408
);
419409
}
420410
}
421-
422-
class TranslatorWithInvalidLocale extends Translator
423-
{
424-
public function getLocale(): string
425-
{
426-
return 'invalid locale';
427-
}
428-
}

src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
/**
2323
* @author Fabien Potencier <[email protected]>
24+
*
25+
* @final since Symfony 7.1
2426
*/
2527
class Translator extends BaseTranslator implements WarmableInterface
2628
{

0 commit comments

Comments
 (0)