Symfony 2.8: ResourceInterface :: isFresh () deprecated since 2.8

After upgrading to Symfony to 2.8, I found a lot of warnings about the failure:

The class "Symfony \ Bundle \ AsseticBundle \ Config \ AsseticResource" is to perform a resource check through ResourceInterface :: isFresh (), which has been deprecated since 2.8 and will be removed 3.0 (54 times)

Stack (from Symfony Profiler)

BCResourceInterfaceChecker::isFresh() (called from bootstrap.php.cache at line 3061) ResourceCheckerConfigCache::isFresh() (called from ResourceCheckerConfigCacheFactory.php at line 45) ResourceCheckerConfigCacheFactory::cache() (called from classes.php at line 1328) Router::getMatcher() (called from classes.php at line 1288) Router::match() (called from classes.php at line 7170) Router::match() (called from classes.php at line 2086) RouterListener::onKernelRequest() call_user_func() (called from WrappedListener.php at line 61) WrappedListener::__invoke() call_user_func() (called from classes.php at line 1853) EventDispatcher::doDispatch() (called from classes.php at line 1771) EventDispatcher::dispatch() (called from TraceableEventDispatcher.php at line 132) TraceableEventDispatcher::dispatch() (called from bootstrap.php.cache at line 3178) HttpKernel::handleRaw() (called from bootstrap.php.cache at line 3151) HttpKernel::handle() (called from bootstrap.php.cache at line 3302) ContainerAwareHttpKernel::handle() (called from bootstrap.php.cache at line 2498) Kernel::handle() (called from app_dev.php at line 29) 

for the update I used:

 composer.phar update symfony/symfony --with-dependencies 

this is my composer .json

 { "name": "framework/symfony", "license": "proprietary", "type": "project", "autoload": { "psr-4": { "": "src/" } }, "require": { "php": ">=5.3.9", "symfony/symfony": "2.8.*", "doctrine/orm": "^2.4.8", "doctrine/doctrine-bundle": "~1.4", "symfony/assetic-bundle": "~2.3", "symfony/swiftmailer-bundle": "~2.3", "symfony/monolog-bundle": "~2.4", "sensio/distribution-bundle": "~4.0", "sensio/framework-extra-bundle": "^3.0.2", "incenteev/composer-parameter-handler": "~2.0" }, "require-dev": { "sensio/generator-bundle": "~2.3" }, "scripts": { "post-install-cmd": [ "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget" ], "post-update-cmd": [ "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget" ] }, "config": { "bin-dir": "bin" }, "extra": { "symfony-app-dir": "app", "symfony-web-dir": "web", "symfony-assets-install": "relative", "incenteev-parameters": { "file": "app/config/parameters.yml" } } } 

How to resolve this failure warning?

+8
php symfony
source share
3 answers

Some search engines have found this: https://knpuniversity.com/screencast/symfony3-upgrade/fix-deprecations-in-bundles

They link to the Assetic GitHub page, which claims that 2.7.1 is ready for Symfony 3. But this is clearly not the case. It is so simple. Assetic is simply not symfony 3 ready, so it generates a lot of evasion warnings in 2.8. a merge request to fix this has not yet been merged.

+13
source share

The dev-master branch is currently compatible with Symfony 3 for several weeks. There is nothing wrong with updating to use it.

composer.json

 .... "symfony/assetic-bundle": "dev-master", .... 

symfony / assetic-bundle composer update

All errors disappear.

+10
source share

Have you tried updating the version of assetic bundle to the latest version?

 "symfony/assetic-bundle": "~2.7", 
+1
source share

All Articles