Completed
Pull Request — master (#3)
by Taras
02:24
created
src/Support/Parser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             $class = $class->getParentClass();
52 52
         }
53 53
 
54
-        $this->properties = (array)call_user_func_array('array_merge', $declarations);
54
+        $this->properties = (array) call_user_func_array('array_merge', $declarations);
55 55
     }
56 56
 
57 57
     /**
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     {
84 84
         preg_match_all($this->getPattern($accessType), $docBlock, $matches, PREG_SET_ORDER);
85 85
 
86
-        return (array)$matches;
86
+        return (array) $matches;
87 87
     }
88 88
 
89 89
     /**
Please login to merge, or discard this patch.
src/Support/Declaration.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
     }
90 90
 
91 91
     /**
92
-     * @param $typeName
92
+     * @param string $typeName
93 93
      * @return array
94 94
      */
95 95
     private function getVarTypeSynonyms($typeName)
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,15 +50,21 @@
 block discarded – undo
50 50
      */
51 51
     public function typeOf($type)
52 52
     {
53
-        if ($this->inTypesArray($type)) return true;
53
+        if ($this->inTypesArray($type)) {
54
+            return true;
55
+        }
54 56
 
55 57
         $typeSynonyms = $this->getVarTypeSynonyms($type);
56 58
         foreach ($typeSynonyms as $typeSynonym) {
57
-            if ($this->inTypesArray($typeSynonym)) return true;
59
+            if ($this->inTypesArray($typeSynonym)) {
60
+                return true;
61
+            }
58 62
         }
59 63
 
60 64
         foreach ($this->types as $class) {
61
-            if (is_subclass_of($type, $class)) true;
65
+            if (is_subclass_of($type, $class)) {
66
+                true;
67
+            }
62 68
         }
63 69
 
64 70
         return false;
Please login to merge, or discard this patch.
src/Setters.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,10 +36,14 @@
 block discarded – undo
36 36
 
37 37
         $parser = Registry::get($this);
38 38
         if ($parser->has($name)) {
39
-            if (!$parser->isWritable($name)) throw new \LogicException(
39
+            if (!$parser->isWritable($name)) {
40
+                throw new \LogicException(
40 41
                 sprintf('Can not set value to read only property %s::$%s', get_class($this), $name));
41
-            if (!$parser->typesAreEqual($name, $value)) throw new \LogicException(
42
+            }
43
+            if (!$parser->typesAreEqual($name, $value)) {
44
+                throw new \LogicException(
42 45
                 sprintf('Can not set value: types mismatch %s::$%s', get_class($this), $name));
46
+            }
43 47
 
44 48
             $this->setPropertyValue($name, $value);
45 49
         }
Please login to merge, or discard this patch.