Skip to content

Commit b60dcaf

Browse files
committed
bug #21232 [FrameworkBundle] removed a deprecation notice when using autowiring (on kernel.class_cache.cache_warmer) (fabpot)
This PR was merged into the 3.3-dev branch. Discussion ---------- [FrameworkBundle] removed a deprecation notice when using autowiring (on kernel.class_cache.cache_warmer) | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a When using autowiring, Symfony uses reflection to list all available classes. So, each class is loaded, and for the `ClassCacheCacheWarmer`, it means that a deprecation notice is triggered. So, I've moved it to when an instance is created instead. Commits ------- eb6ff9c7e3 [FrameworkBundle] removed a deprecation notice when using autowiring (on kernel.class_cache.cache_warmer)
2 parents 7958439 + c5ea5db commit b60dcaf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

CacheWarmer/ClassCacheCacheWarmer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\CacheWarmer;
1313

14-
if (PHP_VERSION_ID >= 70000) {
15-
@trigger_error('The '.__NAMESPACE__.'\ClassCacheCacheWarmer class is deprecated since version 3.3 and will be removed in 4.0.', E_USER_DEPRECATED);
16-
}
17-
1814
use Symfony\Component\ClassLoader\ClassCollectionLoader;
1915
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
2016

@@ -31,6 +27,10 @@ class ClassCacheCacheWarmer implements CacheWarmerInterface
3127

3228
public function __construct(array $declaredClasses = null)
3329
{
30+
if (PHP_VERSION_ID >= 70000) {
31+
@trigger_error('The '.__CLASS__.' class is deprecated since version 3.3 and will be removed in 4.0.', E_USER_DEPRECATED);
32+
}
33+
3434
$this->declaredClasses = $declaredClasses;
3535
}
3636

0 commit comments

Comments
 (0)