@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function initAnnotation(array $properties) |
41 | 41 | { |
42 | - if(count($properties) != 1 || !isset($properties['name']) || !is_string($properties['name'])) |
|
42 | + if (count($properties) != 1 || !isset($properties['name']) || !is_string($properties['name'])) |
|
43 | 43 | { |
44 | 44 | throw new AnnotationException('The @databag annotation requires a property "name" of type string'); |
45 | 45 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function getValue() |
61 | 61 | { |
62 | - if(is_array($this->xPrevValue)) |
|
62 | + if (is_array($this->xPrevValue)) |
|
63 | 63 | { |
64 | 64 | $this->xPrevValue[] = $this->sName; // Append the current value to the array |
65 | 65 | return $this->xPrevValue; |
@@ -38,7 +38,7 @@ |
||
38 | 38 | */ |
39 | 39 | public function initAnnotation(array $properties) |
40 | 40 | { |
41 | - if(count($properties) !== 0 && |
|
41 | + if (count($properties) !== 0 && |
|
42 | 42 | (count($properties) !== 1 || !isset($properties[0]) || !is_bool($properties[0]))) |
43 | 43 | { |
44 | 44 | throw new AnnotationException('the @exclude annotation requires a boolean or no property'); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function initAnnotation(array $properties) |
41 | 41 | { |
42 | - if(count($properties) != 1 || !isset($properties['field']) || !is_string($properties['field'])) |
|
42 | + if (count($properties) != 1 || !isset($properties['field']) || !is_string($properties['field'])) |
|
43 | 43 | { |
44 | 44 | throw new AnnotationException('The @upload annotation requires a property "field" of type string'); |
45 | 45 | } |
@@ -59,6 +59,6 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function getValue() |
61 | 61 | { |
62 | - return "'" . $this->sField . "'" ; // The field id is surrounded with simple quotes. |
|
62 | + return "'" . $this->sField . "'"; // The field id is surrounded with simple quotes. |
|
63 | 63 | } |
64 | 64 | } |
@@ -42,20 +42,20 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function initAnnotation(array $properties) |
44 | 44 | { |
45 | - if(!isset($properties['call']) || !is_string($properties['call'])) |
|
45 | + if (!isset($properties['call']) || !is_string($properties['call'])) |
|
46 | 46 | { |
47 | 47 | throw new AnnotationException('The @after annotation requires a property "call" of type string'); |
48 | 48 | } |
49 | - foreach(array_keys($properties) as $propName) |
|
49 | + foreach (array_keys($properties) as $propName) |
|
50 | 50 | { |
51 | - if($propName !== 'call' && $propName !== 'with') |
|
51 | + if ($propName !== 'call' && $propName !== 'with') |
|
52 | 52 | { |
53 | 53 | throw new AnnotationException('Unknown property "' . $propName . '" in the @after annotation'); |
54 | 54 | } |
55 | 55 | } |
56 | - if(isset($properties['with'])) |
|
56 | + if (isset($properties['with'])) |
|
57 | 57 | { |
58 | - if(!is_array($properties['with'])) |
|
58 | + if (!is_array($properties['with'])) |
|
59 | 59 | { |
60 | 60 | throw new AnnotationException('The "with" property of the @after annotation must be of type array'); |
61 | 61 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function getValue() |
79 | 79 | { |
80 | - if(is_array($this->xPrevValue)) |
|
80 | + if (is_array($this->xPrevValue)) |
|
81 | 81 | { |
82 | 82 | // Add the current value to the array |
83 | 83 | $this->xPrevValue[$this->sMethodName] = $this->sMethodParams; |
@@ -42,20 +42,20 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function initAnnotation(array $properties) |
44 | 44 | { |
45 | - if(!isset($properties['call']) || !is_string($properties['call'])) |
|
45 | + if (!isset($properties['call']) || !is_string($properties['call'])) |
|
46 | 46 | { |
47 | 47 | throw new AnnotationException('The @before annotation requires a property "call" of type string'); |
48 | 48 | } |
49 | - foreach(array_keys($properties) as $propName) |
|
49 | + foreach (array_keys($properties) as $propName) |
|
50 | 50 | { |
51 | - if($propName !== 'call' && $propName !== 'with') |
|
51 | + if ($propName !== 'call' && $propName !== 'with') |
|
52 | 52 | { |
53 | 53 | throw new AnnotationException('Unknown property "' . $propName . '" in the @before annotation'); |
54 | 54 | } |
55 | 55 | } |
56 | - if(isset($properties['with'])) |
|
56 | + if (isset($properties['with'])) |
|
57 | 57 | { |
58 | - if(!is_array($properties['with'])) |
|
58 | + if (!is_array($properties['with'])) |
|
59 | 59 | { |
60 | 60 | throw new AnnotationException('The "with" property of the @before annotation must be of type array'); |
61 | 61 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function getValue() |
79 | 79 | { |
80 | - if(is_array($this->xPrevValue)) |
|
80 | + if (is_array($this->xPrevValue)) |
|
81 | 81 | { |
82 | 82 | // Add the current value to the array |
83 | 83 | $this->xPrevValue[$this->sMethodName] = $this->sMethodParams; |
@@ -136,15 +136,13 @@ |
||
136 | 136 | if(isset($aMethodAttrs['protected'])) |
137 | 137 | { |
138 | 138 | $aProtected[] = $sMethod; // The method is not to be exported. |
139 | - } |
|
140 | - elseif(count($aMethodAttrs) > 0) |
|
139 | + } elseif(count($aMethodAttrs) > 0) |
|
141 | 140 | { |
142 | 141 | $aAttributes[$sMethod] = $aMethodAttrs; |
143 | 142 | } |
144 | 143 | } |
145 | 144 | return [false, $aAttributes, $aProtected]; |
146 | - } |
|
147 | - catch(AnnotationException $e) |
|
145 | + } catch(AnnotationException $e) |
|
148 | 146 | { |
149 | 147 | throw new SetupException($e->getMessage()); |
150 | 148 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public static function register(Container $di, bool $bForce = false) |
71 | 71 | { |
72 | - if(!$bForce && $di->h(AnnotationReader::class)) |
|
72 | + if (!$bForce && $di->h(AnnotationReader::class)) |
|
73 | 73 | { |
74 | 74 | return; |
75 | 75 | } |
@@ -96,15 +96,15 @@ discard block |
||
96 | 96 | }); |
97 | 97 | |
98 | 98 | $aAttributes = []; |
99 | - foreach($aAnnotations as $xAnnotation) |
|
99 | + foreach ($aAnnotations as $xAnnotation) |
|
100 | 100 | { |
101 | 101 | $sName = $xAnnotation->getName(); |
102 | - if(isset($aAttributes[$sName])) |
|
102 | + if (isset($aAttributes[$sName])) |
|
103 | 103 | { |
104 | 104 | $xAnnotation->setPrevValue($aAttributes[$sName]); |
105 | 105 | } |
106 | 106 | $xValue = $xAnnotation->getValue(); |
107 | - if($sName === 'protected' && !$xValue) |
|
107 | + if ($sName === 'protected' && !$xValue) |
|
108 | 108 | { |
109 | 109 | continue; // Ignore annotation @exclude with value false |
110 | 110 | } |
@@ -128,34 +128,34 @@ discard block |
||
128 | 128 | { |
129 | 129 | // Class annotations |
130 | 130 | $aClassAttrs = $this->filterAnnotations($this->xManager->getClassAnnotations($sClass)); |
131 | - if(isset($aClassAttrs['protected'])) |
|
131 | + if (isset($aClassAttrs['protected'])) |
|
132 | 132 | { |
133 | 133 | return [true, [], []]; // The entire class is not to be exported. |
134 | 134 | } |
135 | 135 | |
136 | 136 | $aProtected = []; |
137 | 137 | $aAttributes = []; |
138 | - if(count($aClassAttrs) > 0) |
|
138 | + if (count($aClassAttrs) > 0) |
|
139 | 139 | { |
140 | 140 | $aAttributes['*'] = $aClassAttrs; |
141 | 141 | } |
142 | 142 | |
143 | 143 | // Methods annotations |
144 | - foreach($aMethods as $sMethod) |
|
144 | + foreach ($aMethods as $sMethod) |
|
145 | 145 | { |
146 | 146 | $aMethodAttrs = $this->filterAnnotations($this->xManager->getMethodAnnotations($sClass, $sMethod)); |
147 | - if(isset($aMethodAttrs['protected'])) |
|
147 | + if (isset($aMethodAttrs['protected'])) |
|
148 | 148 | { |
149 | 149 | $aProtected[] = $sMethod; // The method is not to be exported. |
150 | 150 | } |
151 | - elseif(count($aMethodAttrs) > 0) |
|
151 | + elseif (count($aMethodAttrs) > 0) |
|
152 | 152 | { |
153 | 153 | $aAttributes[$sMethod] = $aMethodAttrs; |
154 | 154 | } |
155 | 155 | } |
156 | 156 | return [false, $aAttributes, $aProtected]; |
157 | 157 | } |
158 | - catch(AnnotationException $e) |
|
158 | + catch (AnnotationException $e) |
|
159 | 159 | { |
160 | 160 | throw new SetupException($e->getMessage()); |
161 | 161 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function initAnnotation(array $properties) |
48 | 48 | { |
49 | - if(count($properties) != 2 || |
|
49 | + if (count($properties) != 2 || |
|
50 | 50 | !isset($properties['attr']) || !is_string($properties['attr']) || |
51 | 51 | !isset($properties['class']) || !is_string($properties['class'])) |
52 | 52 | { |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function getValue() |
72 | 72 | { |
73 | - if(is_array($this->xPrevValue)) |
|
73 | + if (is_array($this->xPrevValue)) |
|
74 | 74 | { |
75 | 75 | $this->xPrevValue[$this->sAttr] = $this->sClass; // Append the current value to the array |
76 | 76 | return $this->xPrevValue; |