diff --git a/src/Symfony/Bridge/Twig/Form/TwigRendererEngineInterface.php b/src/Symfony/Bridge/Twig/Form/TwigRendererEngineInterface.php index c5968a1fa768..2fd0cbda79a9 100644 --- a/src/Symfony/Bridge/Twig/Form/TwigRendererEngineInterface.php +++ b/src/Symfony/Bridge/Twig/Form/TwigRendererEngineInterface.php @@ -16,7 +16,7 @@ /** * @author Bernhard Schussek * - * @deprecated Deprecated since version 3.2, to be removed in 4.0. + * @deprecated since version 3.2, to be removed in 4.0. */ interface TwigRendererEngineInterface extends FormRendererEngineInterface { diff --git a/src/Symfony/Bridge/Twig/Form/TwigRendererInterface.php b/src/Symfony/Bridge/Twig/Form/TwigRendererInterface.php index 2b2172b8cce5..85133248f385 100644 --- a/src/Symfony/Bridge/Twig/Form/TwigRendererInterface.php +++ b/src/Symfony/Bridge/Twig/Form/TwigRendererInterface.php @@ -16,7 +16,7 @@ /** * @author Bernhard Schussek * - * @deprecated Deprecated since version 3.2, to be removed in 4.0. + * @deprecated since version 3.2, to be removed in 4.0. */ interface TwigRendererInterface extends FormRendererInterface { diff --git a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ClassCacheCacheWarmer.php b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ClassCacheCacheWarmer.php index b235c6513655..eb407db44de0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ClassCacheCacheWarmer.php +++ b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ClassCacheCacheWarmer.php @@ -11,6 +11,10 @@ namespace Symfony\Bundle\FrameworkBundle\CacheWarmer; +if (PHP_VERSION_ID >= 70000) { + @trigger_error('The '.__NAMESPACE__.'\ClassCacheCacheWarmer class is deprecated since version 3.3 and will be removed in 4.0.', E_USER_DEPRECATED); +} + use Symfony\Component\ClassLoader\ClassCollectionLoader; use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface; @@ -18,6 +22,8 @@ * Generates the Class Cache (classes.php) file. * * @author Tugdual Saunier + * + * @deprecated since version 3.3, to be removed in 4.0. */ class ClassCacheCacheWarmer implements CacheWarmerInterface { diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 68aad4a6a74c..3d948785c2ae 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -71,6 +71,14 @@ public function load(array $configs, ContainerBuilder $container) $loader->load('web.xml'); $loader->load('services.xml'); + + if (PHP_VERSION_ID < 70000) { + $definition = $container->getDefinition('kernel.class_cache.cache_warmer'); + $definition->addTag('kernel.cache_warmer'); + // Ignore deprecation for PHP versions below 7.0 + $definition->setDeprecated(false); + } + $loader->load('fragment_renderer.xml'); // Property access is used by both the Form and the Validator component @@ -194,47 +202,49 @@ public function load(array $configs, ContainerBuilder $container) 'Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller', )); - $this->addClassesToCompile(array( - 'Symfony\\Component\\Config\\ConfigCache', - 'Symfony\\Component\\Config\\FileLocator', - - 'Symfony\\Component\\Debug\\ErrorHandler', - - 'Symfony\\Component\\DependencyInjection\\ContainerAwareInterface', - 'Symfony\\Component\\DependencyInjection\\Container', - - 'Symfony\\Component\\EventDispatcher\\Event', - 'Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher', - - 'Symfony\\Component\\HttpFoundation\\Response', - 'Symfony\\Component\\HttpFoundation\\ResponseHeaderBag', - - 'Symfony\\Component\\HttpKernel\\EventListener\\ResponseListener', - 'Symfony\\Component\\HttpKernel\\EventListener\\RouterListener', - 'Symfony\\Component\\HttpKernel\\Bundle\\Bundle', - 'Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver', - 'Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver', - 'Symfony\\Component\\HttpKernel\\ControllerMetadata\\ArgumentMetadata', - 'Symfony\\Component\\HttpKernel\\ControllerMetadata\\ArgumentMetadataFactory', - 'Symfony\\Component\\HttpKernel\\Event\\KernelEvent', - 'Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent', - 'Symfony\\Component\\HttpKernel\\Event\\FilterResponseEvent', - 'Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent', - 'Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent', - 'Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent', - 'Symfony\\Component\\HttpKernel\\HttpKernel', - 'Symfony\\Component\\HttpKernel\\KernelEvents', - 'Symfony\\Component\\HttpKernel\\Config\\FileLocator', - - 'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerNameParser', - 'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver', - - // Cannot be included because annotations will parse the big compiled class file - // 'Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller', - - // cannot be included as commands are discovered based on the path to this class via Reflection - // 'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle', - )); + if (PHP_VERSION_ID < 70000) { + $this->addClassesToCompile(array( + 'Symfony\\Component\\Config\\ConfigCache', + 'Symfony\\Component\\Config\\FileLocator', + + 'Symfony\\Component\\Debug\\ErrorHandler', + + 'Symfony\\Component\\DependencyInjection\\ContainerAwareInterface', + 'Symfony\\Component\\DependencyInjection\\Container', + + 'Symfony\\Component\\EventDispatcher\\Event', + 'Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher', + + 'Symfony\\Component\\HttpFoundation\\Response', + 'Symfony\\Component\\HttpFoundation\\ResponseHeaderBag', + + 'Symfony\\Component\\HttpKernel\\EventListener\\ResponseListener', + 'Symfony\\Component\\HttpKernel\\EventListener\\RouterListener', + 'Symfony\\Component\\HttpKernel\\Bundle\\Bundle', + 'Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver', + 'Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver', + 'Symfony\\Component\\HttpKernel\\ControllerMetadata\\ArgumentMetadata', + 'Symfony\\Component\\HttpKernel\\ControllerMetadata\\ArgumentMetadataFactory', + 'Symfony\\Component\\HttpKernel\\Event\\KernelEvent', + 'Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent', + 'Symfony\\Component\\HttpKernel\\Event\\FilterResponseEvent', + 'Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent', + 'Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent', + 'Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent', + 'Symfony\\Component\\HttpKernel\\HttpKernel', + 'Symfony\\Component\\HttpKernel\\KernelEvents', + 'Symfony\\Component\\HttpKernel\\Config\\FileLocator', + + 'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerNameParser', + 'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver', + + // Cannot be included because annotations will parse the big compiled class file + // 'Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller', + + // cannot be included as commands are discovered based on the path to this class via Reflection + // 'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle', + )); + } } /** @@ -525,13 +535,15 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co $container->setParameter('request_listener.http_port', $config['http_port']); $container->setParameter('request_listener.https_port', $config['https_port']); - $this->addClassesToCompile(array( - 'Symfony\\Component\\Routing\\Generator\\UrlGenerator', - 'Symfony\\Component\\Routing\\RequestContext', - 'Symfony\\Component\\Routing\\Router', - 'Symfony\\Bundle\\FrameworkBundle\\Routing\\RedirectableUrlMatcher', - $container->findDefinition('router.default')->getClass(), - )); + if (PHP_VERSION_ID < 70000) { + $this->addClassesToCompile(array( + 'Symfony\\Component\\Routing\\Generator\\UrlGenerator', + 'Symfony\\Component\\Routing\\RequestContext', + 'Symfony\\Component\\Routing\\Router', + 'Symfony\\Bundle\\FrameworkBundle\\Routing\\RedirectableUrlMatcher', + $container->findDefinition('router.default')->getClass(), + )); + } } /** @@ -574,20 +586,22 @@ private function registerSessionConfiguration(array $config, ContainerBuilder $c $container->setParameter('session.save_path', $config['save_path']); - $this->addClassesToCompile(array( - 'Symfony\\Bundle\\FrameworkBundle\\EventListener\\SessionListener', - 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage', - 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\PhpBridgeSessionStorage', - 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeFileSessionHandler', - 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\AbstractProxy', - 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\SessionHandlerProxy', - $container->getDefinition('session')->getClass(), - )); - - if ($container->hasDefinition($config['storage_id'])) { + if (PHP_VERSION_ID < 70000) { $this->addClassesToCompile(array( - $container->findDefinition('session.storage')->getClass(), + 'Symfony\\Bundle\\FrameworkBundle\\EventListener\\SessionListener', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\PhpBridgeSessionStorage', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeFileSessionHandler', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\AbstractProxy', + 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\SessionHandlerProxy', + $container->getDefinition('session')->getClass(), )); + + if ($container->hasDefinition($config['storage_id'])) { + $this->addClassesToCompile(array( + $container->findDefinition('session.storage')->getClass(), + )); + } } $container->setParameter('session.metadata.update_threshold', $config['metadata_update_threshold']); @@ -657,12 +671,14 @@ private function registerTemplatingConfiguration(array $config, ContainerBuilder $container->setDefinition('templating.loader', $loaderCache); } - $this->addClassesToCompile(array( - 'Symfony\\Bundle\\FrameworkBundle\\Templating\\GlobalVariables', - 'Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateReference', - 'Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateNameParser', - $container->findDefinition('templating.locator')->getClass(), - )); + if (PHP_VERSION_ID < 70000) { + $this->addClassesToCompile(array( + 'Symfony\\Bundle\\FrameworkBundle\\Templating\\GlobalVariables', + 'Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateReference', + 'Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateNameParser', + $container->findDefinition('templating.locator')->getClass(), + )); + } $container->setParameter('templating.engines', $config['engines']); $engines = array_map(function ($engine) { return new Reference('templating.engine.'.$engine); }, $config['engines']); @@ -695,11 +711,13 @@ private function registerTemplatingConfiguration(array $config, ContainerBuilder $container->setAlias('debug.templating.engine.php', 'templating.engine.php'); } - $this->addClassesToCompile(array( - 'Symfony\\Component\\Templating\\Storage\\FileStorage', - 'Symfony\\Bundle\\FrameworkBundle\\Templating\\PhpEngine', - 'Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader\\FilesystemLoader', - )); + if (PHP_VERSION_ID < 70000) { + $this->addClassesToCompile(array( + 'Symfony\\Component\\Templating\\Storage\\FileStorage', + 'Symfony\\Bundle\\FrameworkBundle\\Templating\\PhpEngine', + 'Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader\\FilesystemLoader', + )); + } if ($container->has('assets.packages')) { $container->getDefinition('templating.helper.assets')->replaceArgument(0, new Reference('assets.packages')); @@ -1015,10 +1033,12 @@ private function registerAnnotationsConfiguration(array $config, ContainerBuilde $definition = $container->findDefinition('annotations.cache_warmer'); $definition->addTag('kernel.cache_warmer'); - $this->addClassesToCompile(array( - 'Symfony\Component\Cache\Adapter\PhpArrayAdapter', - 'Symfony\Component\Cache\DoctrineProvider', - )); + if (PHP_VERSION_ID < 70000) { + $this->addClassesToCompile(array( + 'Symfony\Component\Cache\Adapter\PhpArrayAdapter', + 'Symfony\Component\Cache\DoctrineProvider', + )); + } } elseif ('file' === $config['cache']) { $cacheDir = $container->getParameterBag()->resolveValue($config['file_cache_dir']); @@ -1270,11 +1290,13 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con $propertyAccessDefinition->addTag('monolog.logger', array('channel' => 'cache')); } - $this->addClassesToCompile(array( - 'Symfony\Component\Cache\Adapter\ApcuAdapter', - 'Symfony\Component\Cache\Adapter\FilesystemAdapter', - 'Symfony\Component\Cache\CacheItem', - )); + if (PHP_VERSION_ID < 70000) { + $this->addClassesToCompile(array( + 'Symfony\Component\Cache\Adapter\ApcuAdapter', + 'Symfony\Component\Cache\Adapter\FilesystemAdapter', + 'Symfony\Component\Cache\CacheItem', + )); + } } /** diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml index 6f566c80b513..b01d1ccb52ec 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml @@ -25,7 +25,6 @@ - Symfony\Component\HttpFoundation\ParameterBag Symfony\Component\HttpFoundation\HeaderBag @@ -33,8 +32,8 @@ Symfony\Component\HttpFoundation\ServerBag Symfony\Component\HttpFoundation\Request Symfony\Component\HttpKernel\Kernel - Symfony\Component\ClassLoader\ClassCollectionLoader + The "%service_id%" option is deprecated since version 3.3, to be removed in 4.0. diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/ClassCacheCacheWarmerTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/ClassCacheCacheWarmerTest.php index 889601b01fa6..5e442d662f12 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/ClassCacheCacheWarmerTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/ClassCacheCacheWarmerTest.php @@ -16,6 +16,9 @@ use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\WarmedClass; use Symfony\Bundle\FrameworkBundle\Tests\TestCase; +/** + * @group legacy + */ class ClassCacheCacheWarmerTest extends TestCase { public function testWithDeclaredClasses() diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php index faa28fc1757a..0d8804bea3fd 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php @@ -101,20 +101,22 @@ public function load(array $configs, ContainerBuilder $container) $this->aclLoad($config['acl'], $container); } - // add some required classes for compilation - $this->addClassesToCompile(array( - 'Symfony\Component\Security\Http\Firewall', - 'Symfony\Component\Security\Core\User\UserProviderInterface', - 'Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager', - 'Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage', - 'Symfony\Component\Security\Core\Authorization\AccessDecisionManager', - 'Symfony\Component\Security\Core\Authorization\AuthorizationChecker', - 'Symfony\Component\Security\Core\Authorization\Voter\VoterInterface', - 'Symfony\Bundle\SecurityBundle\Security\FirewallConfig', - 'Symfony\Bundle\SecurityBundle\Security\FirewallMap', - 'Symfony\Bundle\SecurityBundle\Security\FirewallContext', - 'Symfony\Component\HttpFoundation\RequestMatcher', - )); + if (PHP_VERSION_ID < 70000) { + // add some required classes for compilation + $this->addClassesToCompile(array( + 'Symfony\Component\Security\Http\Firewall', + 'Symfony\Component\Security\Core\User\UserProviderInterface', + 'Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager', + 'Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage', + 'Symfony\Component\Security\Core\Authorization\AccessDecisionManager', + 'Symfony\Component\Security\Core\Authorization\AuthorizationChecker', + 'Symfony\Component\Security\Core\Authorization\Voter\VoterInterface', + 'Symfony\Bundle\SecurityBundle\Security\FirewallConfig', + 'Symfony\Bundle\SecurityBundle\Security\FirewallMap', + 'Symfony\Bundle\SecurityBundle\Security\FirewallContext', + 'Symfony\Component\HttpFoundation\RequestMatcher', + )); + } } private function aclLoad($config, ContainerBuilder $container) @@ -191,9 +193,11 @@ private function createAuthorization($config, ContainerBuilder $container) return; } - $this->addClassesToCompile(array( - 'Symfony\\Component\\Security\\Http\\AccessMap', - )); + if (PHP_VERSION_ID < 70000) { + $this->addClassesToCompile(array( + 'Symfony\\Component\\Security\\Http\\AccessMap', + )); + } foreach ($config['access_control'] as $access) { $matcher = $this->createRequestMatcher( diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php b/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php index 5296ac542ca8..cff230d513c3 100644 --- a/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php +++ b/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php @@ -126,16 +126,18 @@ public function load(array $configs, ContainerBuilder $container) $container->getDefinition('twig')->replaceArgument(1, $config); - $this->addClassesToCompile(array( - 'Twig_Environment', - 'Twig_Extension', - 'Twig_Extension_Core', - 'Twig_Extension_Escaper', - 'Twig_Extension_Optimizer', - 'Twig_LoaderInterface', - 'Twig_Markup', - 'Twig_Template', - )); + if (PHP_VERSION_ID < 70000) { + $this->addClassesToCompile(array( + 'Twig_Environment', + 'Twig_Extension', + 'Twig_Extension_Core', + 'Twig_Extension_Escaper', + 'Twig_Extension_Optimizer', + 'Twig_LoaderInterface', + 'Twig_Markup', + 'Twig_Template', + )); + } } private function addTwigPath($twigFilesystemLoaderDefinition, $dir, $bundle) diff --git a/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php b/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php index 9f6e33edbe0a..15e3a5a8220d 100644 --- a/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php +++ b/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php @@ -11,10 +11,16 @@ namespace Symfony\Component\ClassLoader; +if (PHP_VERSION_ID >= 70000) { + @trigger_error('The '.__NAMESPACE__.'\ClassCollectionLoader class is deprecated since version 3.3 and will be removed in 4.0.', E_USER_DEPRECATED); +} + /** * ClassCollectionLoader. * * @author Fabien Potencier + * + * @deprecated since version 3.3, to be removed in 4.0. */ class ClassCollectionLoader { diff --git a/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php b/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php index 4d0234148218..f0b4968c4722 100644 --- a/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php +++ b/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php @@ -20,6 +20,9 @@ require_once __DIR__.'/Fixtures/ClassesWithParents/B.php'; require_once __DIR__.'/Fixtures/ClassesWithParents/A.php'; +/** + * @group legacy + */ class ClassCollectionLoaderTest extends \PHPUnit_Framework_TestCase { public function testTraitDependencies() diff --git a/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php index 7d35996e1bab..98711e00d2d4 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php @@ -98,7 +98,7 @@ protected function cloneVar($var) * * @return string The string representation of the variable * - * @deprecated Deprecated since version 3.2, to be removed in 4.0. Use cloneVar() instead. + * @deprecated since version 3.2, to be removed in 4.0. Use cloneVar() instead. */ protected function varToString($var) { diff --git a/src/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php b/src/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php index e9d012033d6d..09c05940d2df 100644 --- a/src/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php +++ b/src/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php @@ -11,6 +11,10 @@ namespace Symfony\Component\HttpKernel\DependencyInjection; +if (PHP_VERSION_ID >= 70000) { + @trigger_error('The '.__NAMESPACE__.'\AddClassesToCachePass class is deprecated since version 3.3 and will be removed in 4.0.', E_USER_DEPRECATED); +} + use Composer\Autoload\ClassLoader; use Symfony\Component\Debug\DebugClassLoader; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -21,6 +25,8 @@ * Sets the classes to compile in the cache for the container. * * @author Fabien Potencier + * + * @deprecated since version 3.3, to be removed in 4.0. */ class AddClassesToCachePass implements CompilerPassInterface { diff --git a/src/Symfony/Component/HttpKernel/DependencyInjection/Extension.php b/src/Symfony/Component/HttpKernel/DependencyInjection/Extension.php index a71bed04d330..99ae0d4b9010 100644 --- a/src/Symfony/Component/HttpKernel/DependencyInjection/Extension.php +++ b/src/Symfony/Component/HttpKernel/DependencyInjection/Extension.php @@ -47,9 +47,15 @@ public function getAnnotatedClassesToCompile() * Adds classes to the class cache. * * @param array $classes An array of class patterns + * + * @deprecated since version 3.3, to be removed in 4.0. */ public function addClassesToCompile(array $classes) { + if (PHP_VERSION_ID >= 70000) { + @trigger_error(__METHOD__.'() is deprecated since version 3.3, to be removed in 4.0.', E_USER_DEPRECATED); + } + $this->classes = array_merge($this->classes, $classes); } diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index b7b7d81b6198..c0878e20f53e 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -321,17 +321,29 @@ public function getContainer() * * @param string $name The cache name prefix * @param string $extension File extension of the resulting file + * + * @deprecated since version 3.3, to be removed in 4.0. */ public function loadClassCache($name = 'classes', $extension = '.php') { + if (PHP_VERSION_ID >= 70000) { + @trigger_error(__METHOD__.'() is deprecated since version 3.3, to be removed in 4.0.', E_USER_DEPRECATED); + } + $this->loadClassCache = array($name, $extension); } /** * @internal + * + * @deprecated since version 3.3, to be removed in 4.0. */ public function setClassCache(array $classes) { + if (PHP_VERSION_ID >= 70000) { + @trigger_error(__METHOD__.'() is deprecated since version 3.3, to be removed in 4.0.', E_USER_DEPRECATED); + } + file_put_contents($this->getCacheDir().'/classes.map', sprintf('= 70000) { + @trigger_error(__METHOD__.'() is deprecated since version 3.3, to be removed in 4.0.', E_USER_DEPRECATED); + } + if (!$this->booted && is_file($this->getCacheDir().'/classes.map')) { ClassCollectionLoader::load(include($this->getCacheDir().'/classes.map'), $this->getCacheDir(), $name, $this->debug, false, $extension); } @@ -571,7 +590,9 @@ protected function buildContainer() $container->merge($cont); } - $container->addCompilerPass(new AddClassesToCachePass($this)); + if (PHP_VERSION_ID < 70000) { + $container->addCompilerPass(new AddClassesToCachePass($this)); + } $container->addResource(new EnvParametersResource('SYMFONY__')); return $container; diff --git a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/AddClassesToCachePassTest.php b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/AddClassesToCachePassTest.php index fd7a7bc4e60f..834c7b2f6110 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/AddClassesToCachePassTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/AddClassesToCachePassTest.php @@ -13,6 +13,9 @@ use Symfony\Component\HttpKernel\DependencyInjection\AddClassesToCachePass; +/** + * @group legacy + */ class AddClassesToCachePassTest extends \PHPUnit_Framework_TestCase { public function testExpandClasses() diff --git a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php index 2eacb8aeda53..63fa7a46a574 100644 --- a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php @@ -85,6 +85,9 @@ public function testBootSetsTheBootedFlagToTrue() $this->assertTrue($kernel->isBooted()); } + /** + * @group legacy + */ public function testClassCacheIsLoaded() { $kernel = $this->getKernel(array('initializeBundles', 'initializeContainer', 'doLoadClassCache')); @@ -105,6 +108,9 @@ public function testClassCacheIsNotLoadedByDefault() $kernel->boot(); } + /** + * @group legacy + */ public function testClassCacheIsNotLoadedWhenKernelIsNotBooted() { $kernel = $this->getKernel(array('initializeBundles', 'initializeContainer', 'doLoadClassCache')); diff --git a/src/Symfony/Component/PropertyAccess/StringUtil.php b/src/Symfony/Component/PropertyAccess/StringUtil.php index 2c5cc45e8855..6765dd776b2b 100644 --- a/src/Symfony/Component/PropertyAccess/StringUtil.php +++ b/src/Symfony/Component/PropertyAccess/StringUtil.php @@ -18,7 +18,7 @@ * * @author Bernhard Schussek * - * @deprecated Deprecated since version 3.1, to be removed in 4.0. Use {@see Symfony\Component\Inflector\Inflector} instead. + * @deprecated since version 3.1, to be removed in 4.0. Use {@see Symfony\Component\Inflector\Inflector} instead. */ class StringUtil { @@ -40,7 +40,7 @@ private function __construct() * @return string|array The singular form or an array of possible singular * forms * - * @deprecated Deprecated since version 3.1, to be removed in 4.0. Use {@see Symfony\Component\Inflector\Inflector::singularize} instead. + * @deprecated since version 3.1, to be removed in 4.0. Use {@see Symfony\Component\Inflector\Inflector::singularize} instead. */ public static function singularify($plural) {