Browse Source

Remove useless code

Victor Berchet 14 năm trước cách đây
mục cha
commit
2af2260c34

+ 0 - 3
src/Symfony/Bundle/DoctrineAbstractBundle/DependencyInjection/AbstractDoctrineExtension.php

@@ -122,9 +122,6 @@ abstract class AbstractDoctrineExtension extends Extension
     protected function setMappingDriverConfig(array $mappingConfig, $mappingName)
     protected function setMappingDriverConfig(array $mappingConfig, $mappingName)
     {
     {
         if (is_dir($mappingConfig['dir'])) {
         if (is_dir($mappingConfig['dir'])) {
-            if (!isset($this->drivers[$mappingConfig['type']])) {
-                $this->drivers[$mappingConfig['type']] = array();
-            }
             $this->drivers[$mappingConfig['type']][$mappingConfig['prefix']] = realpath($mappingConfig['dir']);
             $this->drivers[$mappingConfig['type']][$mappingConfig['prefix']] = realpath($mappingConfig['dir']);
         } else {
         } else {
             throw new \InvalidArgumentException(sprintf('Invalid Doctrine mapping path given. Cannot load Doctrine mapping/bundle named "%s".', $mappingName));
             throw new \InvalidArgumentException(sprintf('Invalid Doctrine mapping path given. Cannot load Doctrine mapping/bundle named "%s".', $mappingName));

+ 0 - 4
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/FormPass.php

@@ -49,10 +49,6 @@ class FormPass implements CompilerPassInterface
                 ? $tag[0]['alias']
                 ? $tag[0]['alias']
                 : $serviceId;
                 : $serviceId;
 
 
-            if (!isset($typeExtensions[$alias])) {
-                $typeExtensions[$alias] = array();
-            }
-
             $typeExtensions[$alias][] = $serviceId;
             $typeExtensions[$alias][] = $serviceId;
         }
         }
 
 

+ 0 - 4
src/Symfony/Component/DependencyInjection/ContainerBuilder.php

@@ -143,10 +143,6 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
 
 
         $namespace = $this->getExtension($extension)->getAlias();
         $namespace = $this->getExtension($extension)->getAlias();
 
 
-        if (!isset($this->extensionConfigs[$namespace])) {
-            $this->extensionConfigs[$namespace] = array();
-        }
-
         $this->extensionConfigs[$namespace][] = $this->getParameterBag()->resolveValue($values);
         $this->extensionConfigs[$namespace][] = $this->getParameterBag()->resolveValue($values);
 
 
         return $this;
         return $this;

+ 0 - 4
src/Symfony/Component/DependencyInjection/Definition.php

@@ -367,10 +367,6 @@ class Definition
      */
      */
     public function addTag($name, array $attributes = array())
     public function addTag($name, array $attributes = array())
     {
     {
-        if (!isset($this->tags[$name])) {
-            $this->tags[$name] = array();
-        }
-
         $this->tags[$name][] = $attributes;
         $this->tags[$name][] = $attributes;
 
 
         return $this;
         return $this;

+ 0 - 4
src/Symfony/Component/Form/AbstractExtension.php

@@ -194,10 +194,6 @@ abstract class AbstractExtension implements FormExtensionInterface
 
 
             $type = $extension->getExtendedType();
             $type = $extension->getExtendedType();
 
 
-            if (!isset($this->typeExtensions[$type])) {
-                $this->typeExtensions[$type] = array();
-            }
-
             $this->typeExtensions[$type][] = $extension;
             $this->typeExtensions[$type][] = $extension;
         }
         }
     }
     }

+ 0 - 4
src/Symfony/Component/Form/Extension/Core/ChoiceList/TimezoneChoiceList.php

@@ -55,10 +55,6 @@ class TimezoneChoiceList implements ChoiceListInterface
                 $name = $parts[0];
                 $name = $parts[0];
             }
             }
 
 
-            if (!isset(static::$timezones[$region])) {
-                static::$timezones[$region] = array();
-            }
-
             static::$timezones[$region][$timezone] = str_replace('_', ' ', $name);
             static::$timezones[$region][$timezone] = str_replace('_', ' ', $name);
         }
         }
 
 

+ 0 - 4
src/Symfony/Component/Translation/Translator.php

@@ -71,10 +71,6 @@ class Translator implements TranslatorInterface
      */
      */
     public function addResource($format, $resource, $locale, $domain = 'messages')
     public function addResource($format, $resource, $locale, $domain = 'messages')
     {
     {
-        if (!isset($this->resources[$locale])) {
-            $this->resources[$locale] = array();
-        }
-
         $this->resources[$locale][] = array($format, $resource, $domain);
         $this->resources[$locale][] = array($format, $resource, $domain);
     }
     }
 
 

+ 0 - 4
src/Symfony/Component/Validator/Mapping/ClassMetadata.php

@@ -204,10 +204,6 @@ class ClassMetadata extends ElementMetadata
     {
     {
         $property = $metadata->getPropertyName();
         $property = $metadata->getPropertyName();
 
 
-        if (!isset($this->members[$property])) {
-            $this->members[$property] = array();
-        }
-
         $this->members[$property][] = $metadata;
         $this->members[$property][] = $metadata;
     }
     }
 
 

+ 0 - 4
src/Symfony/Component/Validator/Mapping/ElementMetadata.php

@@ -56,10 +56,6 @@ abstract class ElementMetadata
         $this->constraints[] = $constraint;
         $this->constraints[] = $constraint;
 
 
         foreach ($constraint->groups as $group) {
         foreach ($constraint->groups as $group) {
-            if (!isset($this->constraintsByGroup[$group])) {
-                $this->constraintsByGroup[$group] = array();
-            }
-
             $this->constraintsByGroup[$group][] = $constraint;
             $this->constraintsByGroup[$group][] = $constraint;
         }
         }