@@ -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;  | 
                                                        
@@ -47,8 +47,8 @@ discard block  | 
                                                    ||
| 47 | 47 | $this->xManager->registry['upload'] = UploadAnnotation::class;  | 
                                                        
| 48 | 48 | $this->xManager->registry['databag'] = DataBagAnnotation::class;  | 
                                                        
| 49 | 49 | $this->xManager->registry['exclude'] = ExcludeAnnotation::class;  | 
                                                        
| 50 | - $this->xManager->registry['before'] = BeforeAnnotation::class;;  | 
                                                        |
| 51 | - $this->xManager->registry['after'] = AfterAnnotation::class;;  | 
                                                        |
| 50 | + $this->xManager->registry['before'] = BeforeAnnotation::class; ;  | 
                                                        |
| 51 | + $this->xManager->registry['after'] = AfterAnnotation::class; ;  | 
                                                        |
| 52 | 52 | // Missing standard annotations.  | 
                                                        
| 53 | 53 | // We need to define this, otherwise they throw an exception, and make the whole processing fail.  | 
                                                        
| 54 | 54 | $this->xManager->registry['const'] = false;  | 
                                                        
@@ -85,15 +85,15 @@ discard block  | 
                                                    ||
| 85 | 85 | });  | 
                                                        
| 86 | 86 | |
| 87 | 87 | $aAttributes = [];  | 
                                                        
| 88 | - foreach($aAnnotations as $xAnnotation)  | 
                                                        |
| 88 | + foreach ($aAnnotations as $xAnnotation)  | 
                                                        |
| 89 | 89 |          { | 
                                                        
| 90 | 90 | $sName = $xAnnotation->getName();  | 
                                                        
| 91 | - if(isset($aAttributes[$sName]))  | 
                                                        |
| 91 | + if (isset($aAttributes[$sName]))  | 
                                                        |
| 92 | 92 |              { | 
                                                        
| 93 | 93 | $xAnnotation->setPrevValue($aAttributes[$sName]);  | 
                                                        
| 94 | 94 | }  | 
                                                        
| 95 | 95 | $xValue = $xAnnotation->getValue();  | 
                                                        
| 96 | - if($sName === 'protected' && !$xValue)  | 
                                                        |
| 96 | + if ($sName === 'protected' && !$xValue)  | 
                                                        |
| 97 | 97 |              { | 
                                                        
| 98 | 98 | continue; // Ignore annotation @exclude with value false  | 
                                                        
| 99 | 99 | }  | 
                                                        
@@ -117,34 +117,34 @@ discard block  | 
                                                    ||
| 117 | 117 |          { | 
                                                        
| 118 | 118 | // Class annotations  | 
                                                        
| 119 | 119 | $aClassAttrs = $this->filterAnnotations($this->xManager->getClassAnnotations($sClass));  | 
                                                        
| 120 | - if(isset($aClassAttrs['protected']))  | 
                                                        |
| 120 | + if (isset($aClassAttrs['protected']))  | 
                                                        |
| 121 | 121 |              { | 
                                                        
| 122 | 122 | return [true, [], []]; // The entire class is not to be exported.  | 
                                                        
| 123 | 123 | }  | 
                                                        
| 124 | 124 | |
| 125 | 125 | $aProtected = [];  | 
                                                        
| 126 | 126 | $aAttributes = [];  | 
                                                        
| 127 | - if(count($aClassAttrs) > 0)  | 
                                                        |
| 127 | + if (count($aClassAttrs) > 0)  | 
                                                        |
| 128 | 128 |              { | 
                                                        
| 129 | 129 | $aAttributes['*'] = $aClassAttrs;  | 
                                                        
| 130 | 130 | }  | 
                                                        
| 131 | 131 | |
| 132 | 132 | // Methods annotations  | 
                                                        
| 133 | - foreach($aMethods as $sMethod)  | 
                                                        |
| 133 | + foreach ($aMethods as $sMethod)  | 
                                                        |
| 134 | 134 |              { | 
                                                        
| 135 | 135 | $aMethodAttrs = $this->filterAnnotations($this->xManager->getMethodAnnotations($sClass, $sMethod));  | 
                                                        
| 136 | - if(isset($aMethodAttrs['protected']))  | 
                                                        |
| 136 | + if (isset($aMethodAttrs['protected']))  | 
                                                        |
| 137 | 137 |                  { | 
                                                        
| 138 | 138 | $aProtected[] = $sMethod; // The method is not to be exported.  | 
                                                        
| 139 | 139 | }  | 
                                                        
| 140 | - elseif(count($aMethodAttrs) > 0)  | 
                                                        |
| 140 | + elseif (count($aMethodAttrs) > 0)  | 
                                                        |
| 141 | 141 |                  { | 
                                                        
| 142 | 142 | $aAttributes[$sMethod] = $aMethodAttrs;  | 
                                                        
| 143 | 143 | }  | 
                                                        
| 144 | 144 | }  | 
                                                        
| 145 | 145 | return [false, $aAttributes, $aProtected];  | 
                                                        
| 146 | 146 | }  | 
                                                        
| 147 | - catch(AnnotationException $e)  | 
                                                        |
| 147 | + catch (AnnotationException $e)  | 
                                                        |
| 148 | 148 |          { | 
                                                        
| 149 | 149 | throw new SetupException($e->getMessage());  | 
                                                        
| 150 | 150 | }  | 
                                                        
@@ -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 | }  |