Browse Source

Coding style fixes

Jordi Boggiano 14 years ago
parent
commit
e69c5ae860

+ 1 - 1
src/Symfony/Component/Form/CollectionField.php

@@ -72,7 +72,7 @@ class CollectionField extends FieldGroup
 
     public function bind($taintedData)
     {
-        if (is_null($taintedData)) {
+        if (null === $taintedData) {
             $taintedData = array();
         }
 

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

@@ -162,7 +162,7 @@ abstract class Field extends Configurable implements FieldInterface
      */
     public function getName()
     {
-        return is_null($this->parent) ? $this->key : $this->parent->getName().'['.$this->key.']';
+        return null === $this->parent ? $this->key : $this->parent->getName().'['.$this->key.']';
     }
 
     /**
@@ -170,7 +170,7 @@ abstract class Field extends Configurable implements FieldInterface
      */
     public function getId()
     {
-        return is_null($this->parent) ? $this->key : $this->parent->getId().'_'.$this->key;
+        return null === $this->parent ? $this->key : $this->parent->getId().'_'.$this->key;
     }
 
     /**
@@ -186,7 +186,7 @@ abstract class Field extends Configurable implements FieldInterface
      */
     public function isRequired()
     {
-        if (is_null($this->parent) || $this->parent->isRequired()) {
+        if (null === $this->parent || $this->parent->isRequired()) {
             return $this->required;
         }
         return false;
@@ -197,7 +197,7 @@ abstract class Field extends Configurable implements FieldInterface
      */
     public function isDisabled()
     {
-        if (is_null($this->parent) || !$this->parent->isDisabled()) {
+        if (null === $this->parent || !$this->parent->isDisabled()) {
             return $this->getOption('disabled');
         }
         return true;

+ 2 - 2
src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php

@@ -50,7 +50,7 @@ class MimeTypeGuesser implements MimeTypeGuesserInterface
      */
     static public function getInstance()
     {
-        if (is_null(self::$instance)) {
+        if (null === self::$instance) {
             self::$instance = new self();
         }
 
@@ -112,7 +112,7 @@ class MimeTypeGuesser implements MimeTypeGuesserInterface
         foreach ($this->guessers as $guesser) {
             $mimeType = $guesser->guess($path);
 
-            if (!is_null($mimeType)) {
+            if (null !== $mimeType) {
                 break;
             }
         }

+ 3 - 3
src/Symfony/Component/HttpFoundation/File/UploadedFile.php

@@ -47,11 +47,11 @@ class UploadedFile extends File
             $this->path = realpath($path);
         }
 
-        if (is_null($error)) {
+        if (null === $error) {
             $error = UPLOAD_ERR_OK;
         }
 
-        if (is_null($mimeType)) {
+        if (null === $mimeType) {
             $mimeType = 'application/octet-stream';
         }
 
@@ -74,7 +74,7 @@ class UploadedFile extends File
     {
         $mimeType = parent::getMimeType();
 
-        if (is_null($mimeType)) {
+        if (null === $mimeType) {
             $mimeType = $this->mimeType;
         }
 

+ 1 - 1
src/Symfony/Component/Validator/Constraints/NullValidator.php

@@ -18,7 +18,7 @@ class NullValidator extends ConstraintValidator
 {
     public function isValid($value, Constraint $constraint)
     {
-        if (!is_null($value)) {
+        if (null !== $value) {
             $this->setMessage($constraint->message, array('{{ value }}' => $value));
 
             return false;