Passed
Push — main ( fe5adf...e99a91 )
by Thierry
01:50
created
src/Annotation/DataBagAnnotation.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function initAnnotation(array $properties)
63 63
     {
64
-        if(count($properties) !== 1 || !isset($properties['name']) || !is_string($properties['name']))
64
+        if (count($properties) !== 1 || !isset($properties['name']) || !is_string($properties['name']))
65 65
         {
66 66
             throw new AnnotationException('The @databag annotation requires a property "name" of type string');
67 67
         }
68
-        if(!$this->validateDataBagName($properties['name']))
68
+        if (!$this->validateDataBagName($properties['name']))
69 69
         {
70 70
             throw new AnnotationException($properties['name'] . ' is not a valid "name" value for the @databag annotation');
71 71
         }
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      */
86 86
     public function getValue()
87 87
     {
88
-        if(is_array($this->xPrevValue))
88
+        if (is_array($this->xPrevValue))
89 89
         {
90 90
             $this->xPrevValue[] = $this->sName; // Append the current value to the array
91 91
             return $this->xPrevValue;
Please login to merge, or discard this patch.
src/Annotation/CallbackAnnotation.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     public static function parseAnnotation($value)
58 58
     {
59 59
         $aParams = preg_split("/[\s]+/", $value, 2);
60
-        if(count($aParams) === 1)
60
+        if (count($aParams) === 1)
61 61
         {
62 62
             return ['call' => rtrim($aParams[0])];
63 63
         }
@@ -81,28 +81,28 @@  discard block
 block discarded – undo
81 81
      */
82 82
     public function initAnnotation(array $properties)
83 83
     {
84
-        if(!isset($properties['call']) || !is_string($properties['call']))
84
+        if (!isset($properties['call']) || !is_string($properties['call']))
85 85
         {
86 86
             throw new AnnotationException('The @' . $this->getType() .
87 87
                 ' annotation requires a property "call" of type string');
88 88
         }
89
-        if(!$this->validateMethodName($properties['call']))
89
+        if (!$this->validateMethodName($properties['call']))
90 90
         {
91 91
             throw new AnnotationException($properties['call'] .
92 92
                 ' is not a valid "call" value for the @' . $this->getType() . ' annotation');
93 93
         }
94
-        foreach(array_keys($properties) as $propName)
94
+        foreach (array_keys($properties) as $propName)
95 95
         {
96
-            if($propName !== 'call' && $propName !== 'with')
96
+            if ($propName !== 'call' && $propName !== 'with')
97 97
             {
98 98
                 throw new AnnotationException('Unknown property "' . $propName .
99 99
                     '" in the @' . $this->getType() . ' annotation');
100 100
             }
101 101
         }
102 102
         // Cannot use isset here, because it will return false in case $properties['with'] === null
103
-        if(array_key_exists('with', $properties))
103
+        if (array_key_exists('with', $properties))
104 104
         {
105
-            if(!is_array($properties['with']))
105
+            if (!is_array($properties['with']))
106 106
             {
107 107
                 throw new AnnotationException('The "with" property of the @' .
108 108
                     $this->getType() . ' annotation must be of type array');
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      */
118 118
     public function getValue()
119 119
     {
120
-        if(is_array($this->xPrevValue))
120
+        if (is_array($this->xPrevValue))
121 121
         {
122 122
             // Add the current value to the array
123 123
             $this->xPrevValue[$this->sMethodName] = $this->sMethodParams;
Please login to merge, or discard this patch.
src/Annotation/ExcludeAnnotation.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,11 +38,11 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public static function parseAnnotation($value)
40 40
     {
41
-        if($value === 'true')
41
+        if ($value === 'true')
42 42
         {
43 43
             return [true];
44 44
         }
45
-        if($value === 'false')
45
+        if ($value === 'false')
46 46
         {
47 47
             return [false];
48 48
         }
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public function initAnnotation(array $properties)
57 57
     {
58
-        if(count($properties) !== 0 &&
58
+        if (count($properties) !== 0 &&
59 59
             (count($properties) !== 1 || !isset($properties[0]) || !is_bool($properties[0])))
60 60
         {
61 61
             throw new AnnotationException('the @exclude annotation requires a single boolean or no property');
Please login to merge, or discard this patch.
src/Annotation/ContainerAnnotation.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -67,11 +67,11 @@  discard block
 block discarded – undo
67 67
     {
68 68
         $aParams = preg_split("/[\s]+/", $value, 3);
69 69
         $nParamCount = count($aParams);
70
-        if($nParamCount === 1)
70
+        if ($nParamCount === 1)
71 71
         {
72 72
             return ['attr' => rtrim($aParams[0])];
73 73
         }
74
-        if($nParamCount === 2)
74
+        if ($nParamCount === 2)
75 75
         {
76 76
             return ['attr' => rtrim($aParams[0]), 'class' => $aParams[1]];
77 77
         }
@@ -104,18 +104,18 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public function initAnnotation(array $properties)
106 106
     {
107
-        if(count($properties) != 2 ||
107
+        if (count($properties) != 2 ||
108 108
             !isset($properties['attr']) || !is_string($properties['attr']) ||
109 109
             !isset($properties['class']) || !is_string($properties['class']))
110 110
         {
111 111
             throw new AnnotationException('The @di annotation requires a property "attr" of type string ' .
112 112
                 'and a property "class" of type string');
113 113
         }
114
-        if(!$this->validateAttrName($properties['attr']))
114
+        if (!$this->validateAttrName($properties['attr']))
115 115
         {
116 116
             throw new AnnotationException($properties['attr'] . ' is not a valid "attr" value for the @di annotation');
117 117
         }
118
-        if(!$this->validateClassName($properties['class']))
118
+        if (!$this->validateClassName($properties['class']))
119 119
         {
120 120
             throw new AnnotationException($properties['class'] . ' is not a valid "class" value for the @di annotation');
121 121
         }
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
      */
137 137
     public function getValue()
138 138
     {
139
-        if(is_array($this->xPrevValue))
139
+        if (is_array($this->xPrevValue))
140 140
         {
141 141
             $this->xPrevValue[$this->sAttr] = $this->sClass; // Append the current value to the array
142 142
             return $this->xPrevValue;
Please login to merge, or discard this patch.
src/Annotation/UploadAnnotation.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -60,11 +60,11 @@  discard block
 block discarded – undo
60 60
      */
61 61
     public function initAnnotation(array $properties)
62 62
     {
63
-        if(count($properties) != 1 || !isset($properties['field']) || !is_string($properties['field']))
63
+        if (count($properties) != 1 || !isset($properties['field']) || !is_string($properties['field']))
64 64
         {
65 65
             throw new AnnotationException('The @upload annotation requires a property "field" of type string');
66 66
         }
67
-        if(!$this->validateUploadField($properties['field']))
67
+        if (!$this->validateUploadField($properties['field']))
68 68
         {
69 69
             throw new AnnotationException($properties['field'] . ' is not a valid "field" value for the @upload annotation');
70 70
         }
@@ -84,6 +84,6 @@  discard block
 block discarded – undo
84 84
      */
85 85
     public function getValue()
86 86
     {
87
-        return "'" . $this->sField . "'" ; // The field id is surrounded with simple quotes.
87
+        return "'" . $this->sField . "'"; // The field id is surrounded with simple quotes.
88 88
     }
89 89
 }
Please login to merge, or discard this patch.