Przeglądaj źródła

[Form] Removed useless else

Pascal Borreli 14 lat temu
rodzic
commit
03f91ff1e0

+ 4 - 4
src/Symfony/Component/Form/ChoiceField.php

@@ -205,11 +205,11 @@ class ChoiceField extends HybridField
             return new CheckboxField($choice, array(
                 'value' => $choice,
             ));
-        } else {
-            return new RadioField($choice, array(
-                'value' => $choice,
-            ));
         }
+
+        return new RadioField($choice, array(
+            'value' => $choice,
+        ));
     }
 
     /**

+ 2 - 2
src/Symfony/Component/Form/Form.php

@@ -836,9 +836,9 @@ class Form extends Field implements \IteratorAggregate, FormInterface
             }
 
             return $length > $max;
-        } else {
-            return false;
         }
+
+        return false;
     }
 
     /**

+ 4 - 4
src/Symfony/Component/Form/HybridField.php

@@ -95,9 +95,9 @@ class HybridField extends Form
     {
         if ($this->mode === self::FORM) {
             return parent::getDisplayedData();
-        } else {
-            return Field::getDisplayedData();
         }
+
+        return Field::getDisplayedData();
     }
 
     /**
@@ -131,8 +131,8 @@ class HybridField extends Form
     {
         if ($this->mode === self::FORM) {
             return parent::isEmpty();
-        } else {
-            return Field::isEmpty();
         }
+
+        return Field::isEmpty();
     }
 }

+ 2 - 2
src/Symfony/Component/Form/PropertyPath.php

@@ -246,9 +246,9 @@ class PropertyPath implements \IteratorAggregate
 
         if ($currentIndex < $this->length) {
             return $this->readPropertyPath($value, $currentIndex);
-        } else {
-            return $value;
         }
+
+        return $value;
     }
 
     /**