Passed
Push — latest ( 810c85...570e9a )
by Mark
02:34
created
src/Util/Property.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
         \preg_match(self::REGEX, $type, $matches, PREG_UNMATCHED_AS_NULL);
37 37
         $this->callback      = (string) ($matches['callback'] ?? null);
38 38
         $this->customType    = (string) ($matches['customType'] ?? null);
39
-        $this->emptyNullable = ! ! ($matches['emptyNullable'] ?? false);
40
-        $this->iterable      = ! ! ($matches['iterable'] ?? false);
41
-        $this->nullable      = ! ! ($this->emptyNullable || ($matches['nullable'] ?? false));
39
+        $this->emptyNullable = !!($matches['emptyNullable'] ?? false);
40
+        $this->iterable      = !!($matches['iterable'] ?? false);
41
+        $this->nullable      = !!($this->emptyNullable || ($matches['nullable'] ?? false));
42 42
         $this->type          = (string) ($matches['type'] ?? 'mixed');
43 43
         $this->isPhpType     = \in_array($this->type, self::TYPES, true);
44 44
     }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     public function castValue($value)
80 80
     {
81 81
         // Immediately return if nullable or empty.
82
-        if (($this->nullable && $value === null) || ($this->emptyNullable && ! $value)) {
82
+        if (($this->nullable && $value === null) || ($this->emptyNullable && !$value)) {
83 83
             return null;
84 84
         }
85 85
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
             Normalize::setType($value, $this->type);
127 127
         }
128 128
 
129
-        return $this->emptyNullable && ! $value
129
+        return $this->emptyNullable && !$value
130 130
             ? null
131 131
             : $value;
132 132
     }
Please login to merge, or discard this patch.