[POC] add deprecation warning to remove/replace them later

by @ElectricMaxxx

Some issues have been detected in this pull request

Issues that can be fixed by applying a patch

Review the proposed patch then download it to apply it manually or execute the following command from the repository root directory:

$ curl https://fabbot.io/patch/symfony/symfony/27160/304f6050df223c4fccd001362a7a8ab684c5b95b/cs.diff | patch -p0
diff -ru src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php
--- src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php	2018-09-13 02:14:53.691965675 +0000
+++ src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php	2018-09-13 02:14:54.194942666 +0000
@@ -177,11 +177,11 @@
     protected function registerMappingDrivers($objectManager, ContainerBuilder $container)
     {
         // configure metadata driver for each bundle based on the type of mapping files found
-        if ($container->hasDefinition($this->getObjectManagerElementName($objectManager['name'] . '_metadata_driver'))) {
-            $chainDriverDef = $container->getDefinition($this->getObjectManagerElementName($objectManager['name'] . '_metadata_driver'));
+        if ($container->hasDefinition($this->getObjectManagerElementName($objectManager['name'].'_metadata_driver'))) {
+            $chainDriverDef = $container->getDefinition($this->getObjectManagerElementName($objectManager['name'].'_metadata_driver'));
         } else {
             if ($container->hasParameter($this->getObjectManagerElementName('metadata.driver_chain.class'))) {
-                $chainDriverDefinitionClass = '%' . $this->getObjectManagerElementName('metadata.driver_chain.class%');
+                $chainDriverDefinitionClass = '%'.$this->getObjectManagerElementName('metadata.driver_chain.class%');
                 @trigger_error(
                     'Usage of class parameter to carry FQCN through the application is deprecated since version 4.2. Use and implement "getChainDriverClass" instead.',
                     E_USER_DEPRECATED
@@ -207,8 +207,8 @@
                 }
                 $mappingDriverDef->setArguments($args);
             } elseif ('annotation' == $driverType) {
-                if ($container->hasParameter($this->getObjectManagerElementName('metadata.' . $driverType . '.class'))) {
-                    $annotationDriverClass = '%' . $this->getObjectManagerElementName('metadata.' . $driverType . '.class%');
+                if ($container->hasParameter($this->getObjectManagerElementName('metadata.'.$driverType.'.class'))) {
+                    $annotationDriverClass = '%'.$this->getObjectManagerElementName('metadata.'.$driverType.'.class%');
                     @trigger_error(
                         'Usage of class parameter to carry FQCN through the application is deprecated since Symfony 4.2. Use and implement "getAnnotationDriverClass" instead.',
                         E_USER_DEPRECATED
@@ -218,22 +218,22 @@
                 }
 
                 $mappingDriverDef = new Definition(
-                    $annotationDriverClass, [
+                    $annotationDriverClass, array(
                     new Reference($this->getObjectManagerElementName('metadata.annotation_reader')),
                     array_values($driverPaths),
-                ]
+                )
                 );
             } else {
-                if ($container->hasParameter($this->getObjectManagerElementName('metadata.' . $driverType . '.class'))) {
+                if ($container->hasParameter($this->getObjectManagerElementName('metadata.'.$driverType.'.class'))) {
                     @trigger_error(
                         'Usage of class parameter to carry FQCN through the application is deprecated since Symfony 4.2. Use and implement "getMetaDriverClass" instead.',
                         E_USER_DEPRECATED
                     );
-                    $metaDriverClass = '%' . $this->getObjectManagerElementName('metadata.' . $driverType . '.class%');
+                    $metaDriverClass = '%'.$this->getObjectManagerElementName('metadata.'.$driverType.'.class%');
                 } else {
                     $metaDriverClass = $objectManager['mapping_driver_class'];
                 }
-                $mappingDriverDef = new Definition($metaDriverClass, [array_values($driverPaths)]);
+                $mappingDriverDef = new Definition($metaDriverClass, array(array_values($driverPaths)));
             }
             $mappingDriverDef->setPublic(false);
             if (false !== strpos($mappingDriverDef->getClass(), 'yml') || false !== strpos($mappingDriverDef->getClass(), 'xml')) {
@@ -358,14 +358,14 @@
                         'Usage of class parameter for memcached_instance class is deprecated since version 4.2 and will be removed in 5.0. Use configuration values instead.'
                     );
                 }
-                $memcachedClass = !empty($cacheDriver['class']) ? $cacheDriver['class'] : '%' . $this->getObjectManagerElementName('cache.memcached.class') . '%';
+                $memcachedClass = !empty($cacheDriver['class']) ? $cacheDriver['class'] : '%'.$this->getObjectManagerElementName('cache.memcached.class').'%';
                 $memcachedInstanceClass = !empty($cacheDriver['instance_class'])
                     ? $cacheDriver['instance_class']
-                    : '%' . $this->getObjectManagerElementName(
+                    : '%'.$this->getObjectManagerElementName(
                         'cache.memcached_instance.class'
-                    ) . '%';
-                $memcachedHost = !empty($cacheDriver['host']) ? $cacheDriver['host'] : '%' . $this->getObjectManagerElementName('cache.memcached_host') . '%';
-                $memcachedPort = !empty($cacheDriver['port']) ? $cacheDriver['port'] : '%' . $this->getObjectManagerElementName('cache.memcached_port') . '%';
+                    ).'%';
+                $memcachedHost = !empty($cacheDriver['host']) ? $cacheDriver['host'] : '%'.$this->getObjectManagerElementName('cache.memcached_host').'%';
+                $memcachedPort = !empty($cacheDriver['port']) ? $cacheDriver['port'] : '%'.$this->getObjectManagerElementName('cache.memcached_port').'%';
                 $cacheDef = new Definition($memcachedClass);
                 $memcachedInstance = new Definition($memcachedInstanceClass);
                 $memcachedInstance->setPrivate(true);
@@ -387,14 +387,14 @@
                         'Usage of class parameter for redis_instance class is deprecated since version 4.2 and will be removed in 5.0. Use configuration values instead.'
                     );
                 }
-                $redisClass = !empty($cacheDriver['class']) ? $cacheDriver['class'] : '%' . $this->getObjectManagerElementName('cache.redis.class') . '%';
+                $redisClass = !empty($cacheDriver['class']) ? $cacheDriver['class'] : '%'.$this->getObjectManagerElementName('cache.redis.class').'%';
                 $redisInstanceClass = !empty($cacheDriver['instance_class'])
                     ? $cacheDriver['instance_class']
-                    : '%' . $this->getObjectManagerElementName(
+                    : '%'.$this->getObjectManagerElementName(
                         'cache.redis_instance.class'
-                    ) . '%';
-                $redisHost = !empty($cacheDriver['host']) ? $cacheDriver['host'] : '%' . $this->getObjectManagerElementName('cache.redis_host') . '%';
-                $redisPort = !empty($cacheDriver['port']) ? $cacheDriver['port'] : '%' . $this->getObjectManagerElementName('cache.redis_port') . '%';
+                    ).'%';
+                $redisHost = !empty($cacheDriver['host']) ? $cacheDriver['host'] : '%'.$this->getObjectManagerElementName('cache.redis_host').'%';
+                $redisPort = !empty($cacheDriver['port']) ? $cacheDriver['port'] : '%'.$this->getObjectManagerElementName('cache.redis_port').'%';
                 $cacheDef = new Definition($redisClass);
                 $redisInstance = new Definition($redisInstanceClass);
                 $redisInstance->setPrivate(true);
@@ -416,7 +416,7 @@
                         E_USER_DEPRECATED
                     );
                 }
-                $cacheDef = new Definition('%' . $this->getObjectManagerElementName(sprintf('cache.%s.class', $cacheDriver['type'])) . '%');
+                $cacheDef = new Definition('%'.$this->getObjectManagerElementName(sprintf('cache.%s.class', $cacheDriver['type'])).'%');
                 break;
             default:
                 throw new \InvalidArgumentException(sprintf('"%s" is an unrecognized Doctrine cache driver.', $cacheDriver['type']));

0
Common Typos

0
License Headers

0
Pull Request Contributor Headers

0
File Permissions