Skip to content

Commit 71d348a

Browse files
feature #53151 mark classes implementing the WarmableInterface as final (xabbuh)
This PR was merged into the 7.1 branch. Discussion ---------- mark classes implementing the `WarmableInterface` as `final` | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT Commits ------- a1cdb47bfe mark classes implementing the WarmableInterface as final
2 parents e2e9ad1 + 8321081 commit 71d348a

File tree

8 files changed

+13
-18
lines changed

8 files changed

+13
-18
lines changed

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

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 <tobias.nyholm@gmail.com>
28+
*
29+
* @final since Symfony 7.1
2830
*/
2931
class ConfigBuilderCacheWarmer implements CacheWarmerInterface
3032
{

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 <galopintitouan@gmail.com>
26+
*
27+
* @final since Symfony 7.1
2628
*/
2729
class SerializerCacheWarmer extends AbstractPhpFileCacheWarmer
2830
{

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 <xavier.leune@gmail.com>
24+
*
25+
* @final since Symfony 7.1
2426
*/
2527
class TranslationsCacheWarmer implements CacheWarmerInterface, ServiceSubscriberInterface
2628
{

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 <galopintitouan@gmail.com>
27+
*
28+
* @final since Symfony 7.1
2729
*/
2830
class ValidatorCacheWarmer extends AbstractPhpFileCacheWarmer
2931
{

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 <fabien@symfony.com>
33+
*
34+
* @final since Symfony 7.1
3335
*/
3436
class Router extends BaseRouter implements WarmableInterface, ServiceSubscriberInterface
3537
{

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-
}

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 <fabien@symfony.com>
24+
*
25+
* @final since Symfony 7.1
2426
*/
2527
class Translator extends BaseTranslator implements WarmableInterface
2628
{

0 commit comments

Comments
 (0)