| @@ -116,17 +116,17 @@ | ||
| 116 | 116 | $explicitAlias = true; | 
| 117 | 117 | $alias = ''; | 
| 118 | 118 |              } else if ($token === ',') { | 
| 119 | - $statements[strtolower($alias)] = $groupRoot . $class; | |
| 119 | + $statements[strtolower($alias)] = $groupRoot.$class; | |
| 120 | 120 | $class = ''; | 
| 121 | 121 | $alias = ''; | 
| 122 | 122 | $explicitAlias = false; | 
| 123 | 123 |              } else if ($token === ';') { | 
| 124 | - $statements[strtolower($alias)] = $groupRoot . $class; | |
| 124 | + $statements[strtolower($alias)] = $groupRoot.$class; | |
| 125 | 125 | break; | 
| 126 | -            } else if ($token === '{' ) { | |
| 126 | +            } else if ($token === '{') { | |
| 127 | 127 | $groupRoot = $class; | 
| 128 | 128 | $class = ''; | 
| 129 | -            } else if ($token === '}' ) { | |
| 129 | +            } else if ($token === '}') { | |
| 130 | 130 | continue; | 
| 131 | 131 |              } else { | 
| 132 | 132 | break; | 
| @@ -75,13 +75,13 @@ discard block | ||
| 75 | 75 | */ | 
| 76 | 76 | public function __construct(array $values) | 
| 77 | 77 |      { | 
| 78 | -        if (!isset($values['value'])){ | |
| 78 | +        if (!isset($values['value'])) { | |
| 79 | 79 | $values['value'] = null; | 
| 80 | 80 | } | 
| 81 | -        if (is_string($values['value'])){ | |
| 81 | +        if (is_string($values['value'])) { | |
| 82 | 82 | $values['value'] = [$values['value']]; | 
| 83 | 83 | } | 
| 84 | -        if (!is_array($values['value'])){ | |
| 84 | +        if (!is_array($values['value'])) { | |
| 85 | 85 | throw new \InvalidArgumentException( | 
| 86 | 86 |                  sprintf('@Target expects either a string value, or an array of strings, "%s" given.', | 
| 87 | 87 | is_object($values['value']) ? get_class($values['value']) : gettype($values['value']) | 
| @@ -91,10 +91,10 @@ discard block | ||
| 91 | 91 | |
| 92 | 92 | $bitmask = 0; | 
| 93 | 93 |          foreach ($values['value'] as $literal) { | 
| 94 | -            if(!isset(self::$map[$literal])){ | |
| 94 | +            if (!isset(self::$map[$literal])) { | |
| 95 | 95 | throw new \InvalidArgumentException( | 
| 96 | 96 |                      sprintf('Invalid Target "%s". Available targets: [%s]', | 
| 97 | -                            $literal,  implode(', ', array_keys(self::$map))) | |
| 97 | +                            $literal, implode(', ', array_keys(self::$map))) | |
| 98 | 98 | ); | 
| 99 | 99 | } | 
| 100 | 100 | $bitmask |= self::$map[$literal]; | 
| @@ -56,12 +56,12 @@ discard block | ||
| 56 | 56 | */ | 
| 57 | 57 | public function __construct(array $values) | 
| 58 | 58 |      { | 
| 59 | -        if ( ! isset($values['literal'])) { | |
| 59 | +        if (!isset($values['literal'])) { | |
| 60 | 60 | $values['literal'] = []; | 
| 61 | 61 | } | 
| 62 | 62 | |
| 63 | 63 |          foreach ($values['value'] as $var) { | 
| 64 | -            if( ! is_scalar($var)) { | |
| 64 | +            if (!is_scalar($var)) { | |
| 65 | 65 | throw new \InvalidArgumentException(sprintf( | 
| 66 | 66 | '@Enum supports only scalar values "%s" given.', | 
| 67 | 67 | is_object($var) ? get_class($var) : gettype($var) | 
| @@ -70,10 +70,10 @@ discard block | ||
| 70 | 70 | } | 
| 71 | 71 | |
| 72 | 72 |          foreach ($values['literal'] as $key => $var) { | 
| 73 | -            if( ! in_array($key, $values['value'])) { | |
| 73 | +            if (!in_array($key, $values['value'])) { | |
| 74 | 74 | throw new \InvalidArgumentException(sprintf( | 
| 75 | 75 | 'Undefined enumerator value "%s" for literal "%s".', | 
| 76 | - $key , $var | |
| 76 | + $key, $var | |
| 77 | 77 | )); | 
| 78 | 78 | } | 
| 79 | 79 | } | 
| @@ -39,7 +39,7 @@ discard block | ||
| 39 | 39 | */ | 
| 40 | 40 | public static function syntaxError($message) | 
| 41 | 41 |      { | 
| 42 | -        return new self('[Syntax Error] ' . $message); | |
| 42 | +        return new self('[Syntax Error] '.$message); | |
| 43 | 43 | } | 
| 44 | 44 | |
| 45 | 45 | /** | 
| @@ -51,7 +51,7 @@ discard block | ||
| 51 | 51 | */ | 
| 52 | 52 | public static function semanticalError($message) | 
| 53 | 53 |      { | 
| 54 | -        return new self('[Semantical Error] ' . $message); | |
| 54 | +        return new self('[Semantical Error] '.$message); | |
| 55 | 55 | } | 
| 56 | 56 | |
| 57 | 57 | /** | 
| @@ -66,7 +66,7 @@ discard block | ||
| 66 | 66 | */ | 
| 67 | 67 | public static function creationError($message) | 
| 68 | 68 |      { | 
| 69 | -        return new self('[Creation Error] ' . $message); | |
| 69 | +        return new self('[Creation Error] '.$message); | |
| 70 | 70 | } | 
| 71 | 71 | |
| 72 | 72 | /** | 
| @@ -80,7 +80,7 @@ discard block | ||
| 80 | 80 | */ | 
| 81 | 81 | public static function typeError($message) | 
| 82 | 82 |      { | 
| 83 | -        return new self('[Type Error] ' . $message); | |
| 83 | +        return new self('[Type Error] '.$message); | |
| 84 | 84 | } | 
| 85 | 85 | |
| 86 | 86 | /** | 
| @@ -98,7 +98,7 @@ discard block | ||
| 98 | 98 | return self::semanticalError(sprintf( | 
| 99 | 99 | "Couldn't find constant %s%s.", | 
| 100 | 100 | $identifier, | 
| 101 | - $context ? ', ' . $context : '' | |
| 101 | + $context ? ', '.$context : '' | |
| 102 | 102 | )); | 
| 103 | 103 | } | 
| 104 | 104 | |
| @@ -123,7 +123,7 @@ discard block | ||
| 123 | 123 | $annotationName, | 
| 124 | 124 | $context, | 
| 125 | 125 | $expected, | 
| 126 | - is_object($actual) ? 'an instance of ' . get_class($actual) : gettype($actual) | |
| 126 | + is_object($actual) ? 'an instance of '.get_class($actual) : gettype($actual) | |
| 127 | 127 | )); | 
| 128 | 128 | } | 
| 129 | 129 | |
| @@ -141,7 +141,7 @@ discard block | ||
| 141 | 141 | $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class)); | 
| 142 | 142 | $this->parser->setIgnoredAnnotationNamespaces(self::$globalIgnoredNamespaces); | 
| 143 | 143 | |
| 144 | - return $this->parser->parse($class->getDocComment(), 'class ' . $class->getName()); | |
| 144 | + return $this->parser->parse($class->getDocComment(), 'class '.$class->getName()); | |
| 145 | 145 | } | 
| 146 | 146 | |
| 147 | 147 | /** | 
| @@ -166,7 +166,7 @@ discard block | ||
| 166 | 166 | public function getPropertyAnnotations(ReflectionProperty $property) | 
| 167 | 167 |      { | 
| 168 | 168 | $class = $property->getDeclaringClass(); | 
| 169 | - $context = 'property ' . $class->getName() . "::\$" . $property->getName(); | |
| 169 | + $context = 'property '.$class->getName()."::\$".$property->getName(); | |
| 170 | 170 | |
| 171 | 171 | $this->parser->setTarget(Target::TARGET_PROPERTY); | 
| 172 | 172 | $this->parser->setImports($this->getPropertyImports($property)); | 
| @@ -198,7 +198,7 @@ discard block | ||
| 198 | 198 | public function getMethodAnnotations(ReflectionMethod $method) | 
| 199 | 199 |      { | 
| 200 | 200 | $class = $method->getDeclaringClass(); | 
| 201 | - $context = 'method ' . $class->getName() . '::' . $method->getName() . '()'; | |
| 201 | + $context = 'method '.$class->getName().'::'.$method->getName().'()'; | |
| 202 | 202 | |
| 203 | 203 | $this->parser->setTarget(Target::TARGET_METHOD); | 
| 204 | 204 | $this->parser->setImports($this->getMethodImports($method)); | 
| @@ -318,7 +318,7 @@ discard block | ||
| 318 | 318 | private function collectParsingMetadata(ReflectionClass $class) | 
| 319 | 319 |      { | 
| 320 | 320 | $ignoredAnnotationNames = self::$globalIgnoredNames; | 
| 321 | - $annotations = $this->preParser->parse($class->getDocComment(), 'class ' . $class->name); | |
| 321 | + $annotations = $this->preParser->parse($class->getDocComment(), 'class '.$class->name); | |
| 322 | 322 | |
| 323 | 323 |          foreach ($annotations as $annotation) { | 
| 324 | 324 |              if ($annotation instanceof IgnoreAnnotation) { | 
| @@ -53,8 +53,8 @@ discard block | ||
| 53 | 53 | } | 
| 54 | 54 | |
| 55 | 55 | $namespace = preg_quote($class->getNamespaceName()); | 
| 56 | -        $content = preg_replace('/^.*?(\bnamespace\s+' . $namespace . '\s*[;{].*)$/s', '\\1', $content); | |
| 57 | -        $tokenizer = new TokenParser('<?php ' . $content); | |
| 56 | +        $content = preg_replace('/^.*?(\bnamespace\s+'.$namespace.'\s*[;{].*)$/s', '\\1', $content); | |
| 57 | +        $tokenizer = new TokenParser('<?php '.$content); | |
| 58 | 58 | |
| 59 | 59 | $statements = $tokenizer->parseUseStatements($class->getNamespaceName()); | 
| 60 | 60 | |
| @@ -71,7 +71,7 @@ discard block | ||
| 71 | 71 | */ | 
| 72 | 72 | private function getFileContent($filename, $lineNumber) | 
| 73 | 73 |      { | 
| 74 | -        if ( ! is_file($filename)) { | |
| 74 | +        if (!is_file($filename)) { | |
| 75 | 75 | return null; | 
| 76 | 76 | } | 
| 77 | 77 | |
| @@ -106,7 +106,7 @@ | ||
| 106 | 106 | ', ', | 
| 107 | 107 | array_filter( | 
| 108 | 108 | self::LABELS, | 
| 109 | -                function (int $target) : bool { | |
| 109 | +                function(int $target) : bool { | |
| 110 | 110 | return ($this->target & $target) === $target; | 
| 111 | 111 | }, | 
| 112 | 112 | ARRAY_FILTER_USE_KEY | 
| @@ -45,7 +45,7 @@ discard block | ||
| 45 | 45 | $this->usesConstructor = $hasConstructor; | 
| 46 | 46 | $this->properties = array_combine( | 
| 47 | 47 | array_map( | 
| 48 | -                static function (PropertyMetadata $property) : string { | |
| 48 | +                static function(PropertyMetadata $property) : string { | |
| 49 | 49 | return $property->getName(); | 
| 50 | 50 | }, | 
| 51 | 51 | $properties | 
| @@ -56,7 +56,7 @@ discard block | ||
| 56 | 56 | $defaultProperties = array_values( | 
| 57 | 57 | array_filter( | 
| 58 | 58 | $properties, | 
| 59 | -                static function (PropertyMetadata $property) : bool { | |
| 59 | +                static function(PropertyMetadata $property) : bool { | |
| 60 | 60 | return $property->isDefault(); | 
| 61 | 61 | } | 
| 62 | 62 | ) | 
| @@ -521,7 +521,7 @@ discard block | ||
| 521 | 521 | } | 
| 522 | 522 | |
| 523 | 523 | // Checks if the property has type[] | 
| 524 | -         if (false !== $pos = strrpos($type, '[')) { | |
| 524 | +            if (false !== $pos = strrpos($type, '[')) { | |
| 525 | 525 | $arrayType = substr($type, 0, $pos); | 
| 526 | 526 | |
| 527 | 527 | return $metadata->withType([ | 
| @@ -670,7 +670,7 @@ discard block | ||
| 670 | 670 |          if (($this->metadata->get($name)->getTarget()->unwrap() & $target) === 0 && $target) { | 
| 671 | 671 | throw AnnotationException::semanticalError( | 
| 672 | 672 |                  sprintf('Annotation @%s is not allowed to be declared on %s. You may only use this annotation on these code elements: %s.', | 
| 673 | - $originalName, $this->context, $this->metadata->get($name)->getTarget()->describe()) | |
| 673 | + $originalName, $this->context, $this->metadata->get($name)->getTarget()->describe()) | |
| 674 | 674 | ); | 
| 675 | 675 | } | 
| 676 | 676 | |
| @@ -855,9 +855,9 @@ discard block | ||
| 855 | 855 | case !empty ($this->namespaces): | 
| 856 | 856 |                      foreach ($this->namespaces as $ns) { | 
| 857 | 857 |                          if (class_exists($ns.'\\'.$className) || interface_exists($ns.'\\'.$className)) { | 
| 858 | - $className = $ns.'\\'.$className; | |
| 859 | - $found = true; | |
| 860 | - break; | |
| 858 | + $className = $ns.'\\'.$className; | |
| 859 | + $found = true; | |
| 860 | + break; | |
| 861 | 861 | } | 
| 862 | 862 | } | 
| 863 | 863 | break; | 
| @@ -882,7 +882,7 @@ discard block | ||
| 882 | 882 | } | 
| 883 | 883 | |
| 884 | 884 |              if ($found) { | 
| 885 | - $identifier = $className . '::' . $const; | |
| 885 | + $identifier = $className . '::' . $const; | |
| 886 | 886 | } | 
| 887 | 887 | } | 
| 888 | 888 | |
| @@ -301,7 +301,7 @@ discard block | ||
| 301 | 301 | */ | 
| 302 | 302 | private function match($token) | 
| 303 | 303 |      { | 
| 304 | -        if ( ! $this->lexer->isNextToken($token) ) { | |
| 304 | +        if (!$this->lexer->isNextToken($token)) { | |
| 305 | 305 | $this->syntaxError($this->lexer->getLiteral($token)); | 
| 306 | 306 | } | 
| 307 | 307 | |
| @@ -320,7 +320,7 @@ discard block | ||
| 320 | 320 | */ | 
| 321 | 321 | private function matchAny(array $tokens) | 
| 322 | 322 |      { | 
| 323 | -        if ( ! $this->lexer->isNextTokenAny($tokens)) { | |
| 323 | +        if (!$this->lexer->isNextTokenAny($tokens)) { | |
| 324 | 324 |              $this->syntaxError(implode(' or ', array_map([$this->lexer, 'getLiteral'], $tokens))); | 
| 325 | 325 | } | 
| 326 | 326 | |
| @@ -349,7 +349,7 @@ discard block | ||
| 349 | 349 |              : sprintf("'%s' at position %s", $token['value'], $token['position']); | 
| 350 | 350 | |
| 351 | 351 |          if (strlen($this->context)) { | 
| 352 | - $message .= ' in ' . $this->context; | |
| 352 | + $message .= ' in '.$this->context; | |
| 353 | 353 | } | 
| 354 | 354 | |
| 355 | 355 | $message .= '.'; | 
| @@ -415,7 +415,7 @@ discard block | ||
| 415 | 415 | |
| 416 | 416 | self::$metadataParser->setTarget(Target::TARGET_CLASS); | 
| 417 | 417 | |
| 418 | -        foreach (self::$metadataParser->parse($docComment, 'class @' . $name) as $annotation) { | |
| 418 | +        foreach (self::$metadataParser->parse($docComment, 'class @'.$name) as $annotation) { | |
| 419 | 419 |              if ($annotation instanceof Target) { | 
| 420 | 420 | $annotationBuilder = $annotationBuilder->withTarget(AnnotationTarget::fromAnnotation($annotation)); | 
| 421 | 421 | |
| @@ -432,7 +432,7 @@ discard block | ||
| 432 | 432 | } | 
| 433 | 433 | |
| 434 | 434 | // if there is no constructor we will inject values into public properties | 
| 435 | -        if (! $useConstructor) { | |
| 435 | +        if (!$useConstructor) { | |
| 436 | 436 | // collect all public properties | 
| 437 | 437 |              foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC) as $i => $property) { | 
| 438 | 438 | $propertyBuilder = new PropertyMetadataBuilder($property->getName()); | 
| @@ -452,7 +452,7 @@ discard block | ||
| 452 | 452 | $attribute = new Attribute(); | 
| 453 | 453 | $attribute->required = (false !== strpos($propertyComment, '@Required')); | 
| 454 | 454 | $attribute->name = $property->name; | 
| 455 | -                $attribute->type     = (false !== strpos($propertyComment, '@var') && preg_match('/@var\s+([^\s]+)/',$propertyComment, $matches)) | |
| 455 | +                $attribute->type     = (false !== strpos($propertyComment, '@var') && preg_match('/@var\s+([^\s]+)/', $propertyComment, $matches)) | |
| 456 | 456 | ? $matches[1] | 
| 457 | 457 | : 'mixed'; | 
| 458 | 458 | |
| @@ -460,18 +460,18 @@ discard block | ||
| 460 | 460 | |
| 461 | 461 | // checks if the property has @Enum | 
| 462 | 462 |                  if (false !== strpos($propertyComment, '@Enum')) { | 
| 463 | - $context = 'property ' . $class->name . "::\$" . $property->name; | |
| 463 | + $context = 'property '.$class->name."::\$".$property->name; | |
| 464 | 464 | |
| 465 | 465 | self::$metadataParser->setTarget(Target::TARGET_PROPERTY); | 
| 466 | 466 | |
| 467 | 467 |                      foreach (self::$metadataParser->parse($propertyComment, $context) as $annotation) { | 
| 468 | -                        if ( ! $annotation instanceof Enum) { | |
| 468 | +                        if (!$annotation instanceof Enum) { | |
| 469 | 469 | continue; | 
| 470 | 470 | } | 
| 471 | 471 | |
| 472 | 472 | $propertyBuilder = $propertyBuilder->withEnum([ | 
| 473 | 473 | 'value' => $annotation->value, | 
| 474 | - 'literal' => ( ! empty($annotation->literal)) | |
| 474 | + 'literal' => (!empty($annotation->literal)) | |
| 475 | 475 | ? $annotation->literal | 
| 476 | 476 | : $annotation->value, | 
| 477 | 477 | ]); | 
| @@ -599,7 +599,7 @@ discard block | ||
| 599 | 599 | |
| 600 | 600 |          if ('\\' !== $name[0]) { | 
| 601 | 601 | $pos = strpos($name, '\\'); | 
| 602 | - $alias = (false === $pos)? $name : substr($name, 0, $pos); | |
| 602 | + $alias = (false === $pos) ? $name : substr($name, 0, $pos); | |
| 603 | 603 | $found = false; | 
| 604 | 604 | $loweredAlias = strtolower($alias); | 
| 605 | 605 | |
| @@ -614,19 +614,19 @@ discard block | ||
| 614 | 614 |              } elseif (isset($this->imports[$loweredAlias])) { | 
| 615 | 615 | $found = true; | 
| 616 | 616 | $name = (false !== $pos) | 
| 617 | - ? $this->imports[$loweredAlias] . substr($name, $pos) | |
| 617 | + ? $this->imports[$loweredAlias].substr($name, $pos) | |
| 618 | 618 | : $this->imports[$loweredAlias]; | 
| 619 | - } elseif ( ! isset($this->ignoredAnnotationNames[$name]) | |
| 619 | + } elseif (!isset($this->ignoredAnnotationNames[$name]) | |
| 620 | 620 | && isset($this->imports['__NAMESPACE__']) | 
| 621 | - && $this->classExists($this->imports['__NAMESPACE__'] . '\\' . $name) | |
| 621 | + && $this->classExists($this->imports['__NAMESPACE__'].'\\'.$name) | |
| 622 | 622 |              ) { | 
| 623 | 623 | $name = $this->imports['__NAMESPACE__'].'\\'.$name; | 
| 624 | 624 | $found = true; | 
| 625 | -            } elseif (! isset($this->ignoredAnnotationNames[$name]) && $this->classExists($name)) { | |
| 625 | +            } elseif (!isset($this->ignoredAnnotationNames[$name]) && $this->classExists($name)) { | |
| 626 | 626 | $found = true; | 
| 627 | 627 | } | 
| 628 | 628 | |
| 629 | -            if ( ! $found) { | |
| 629 | +            if (!$found) { | |
| 630 | 630 |                  if ($this->isIgnoredAnnotation($name)) { | 
| 631 | 631 | return false; | 
| 632 | 632 | } | 
| @@ -635,9 +635,9 @@ discard block | ||
| 635 | 635 | } | 
| 636 | 636 | } | 
| 637 | 637 | |
| 638 | - $name = ltrim($name,'\\'); | |
| 638 | + $name = ltrim($name, '\\'); | |
| 639 | 639 | |
| 640 | -        if ( ! $this->classExists($name)) { | |
| 640 | +        if (!$this->classExists($name)) { | |
| 641 | 641 |              throw AnnotationException::semanticalError(sprintf('The annotation "@%s" in %s does not exist, or could not be auto-loaded.', $name, $this->context)); | 
| 642 | 642 | } | 
| 643 | 643 | |
| @@ -647,7 +647,7 @@ discard block | ||
| 647 | 647 | |
| 648 | 648 | |
| 649 | 649 | // collects the metadata annotation only if there is not yet | 
| 650 | -        if (! $this->metadata->has($name) && ! array_key_exists($name, $this->nonAnnotationClasses)) { | |
| 650 | +        if (!$this->metadata->has($name) && !array_key_exists($name, $this->nonAnnotationClasses)) { | |
| 651 | 651 | $this->collectAnnotationMetadata($name); | 
| 652 | 652 | } | 
| 653 | 653 | |
| @@ -682,7 +682,7 @@ discard block | ||
| 682 | 682 | $enum = $property->getEnum(); | 
| 683 | 683 | |
| 684 | 684 | // checks if the attribute is a valid enumerator | 
| 685 | -            if ($enum !== null && isset($values[$propertyName]) && ! in_array($values[$propertyName], $enum['value'])) { | |
| 685 | +            if ($enum !== null && isset($values[$propertyName]) && !in_array($values[$propertyName], $enum['value'])) { | |
| 686 | 686 | throw AnnotationException::enumeratorError($propertyName, $name, $this->context, $enum['literal'], $values[$propertyName]); | 
| 687 | 687 | } | 
| 688 | 688 | } | 
| @@ -698,9 +698,9 @@ discard block | ||
| 698 | 698 | } | 
| 699 | 699 | |
| 700 | 700 | // handle a not given attribute or null value | 
| 701 | -            if (! isset($values[$valueName])) { | |
| 701 | +            if (!isset($values[$valueName])) { | |
| 702 | 702 |                  if ($property->isRequired()) { | 
| 703 | - throw AnnotationException::requiredError($propertyName, $originalName, $this->context, 'a(n) ' . $type['value']); | |
| 703 | + throw AnnotationException::requiredError($propertyName, $originalName, $this->context, 'a(n) '.$type['value']); | |
| 704 | 704 | } | 
| 705 | 705 | |
| 706 | 706 | continue; | 
| @@ -708,7 +708,7 @@ discard block | ||
| 708 | 708 | |
| 709 | 709 |              if ($type !== null && $type['type'] === 'array') { | 
| 710 | 710 | // handle the case of a single value | 
| 711 | -                if ( ! is_array($values[$valueName])) { | |
| 711 | +                if (!is_array($values[$valueName])) { | |
| 712 | 712 | $values[$valueName] = [$values[$valueName]]; | 
| 713 | 713 | } | 
| 714 | 714 | |
| @@ -734,7 +734,7 @@ discard block | ||
| 734 | 734 | $instance = new $name(); | 
| 735 | 735 | |
| 736 | 736 |          foreach ($values as $property => $value) { | 
| 737 | -            if (! isset($this->metadata->get($name)->getProperties()[$property])) { | |
| 737 | +            if (!isset($this->metadata->get($name)->getProperties()[$property])) { | |
| 738 | 738 |                  if ('value' !== $property) { | 
| 739 | 739 | throw AnnotationException::creationError( | 
| 740 | 740 | sprintf( | 
| @@ -772,13 +772,13 @@ discard block | ||
| 772 | 772 |      { | 
| 773 | 773 | $values = []; | 
| 774 | 774 | |
| 775 | -        if ( ! $this->lexer->isNextToken(DocLexer::T_OPEN_PARENTHESIS)) { | |
| 775 | +        if (!$this->lexer->isNextToken(DocLexer::T_OPEN_PARENTHESIS)) { | |
| 776 | 776 | return $values; | 
| 777 | 777 | } | 
| 778 | 778 | |
| 779 | 779 | $this->match(DocLexer::T_OPEN_PARENTHESIS); | 
| 780 | 780 | |
| 781 | -        if ( ! $this->lexer->isNextToken(DocLexer::T_CLOSE_PARENTHESIS)) { | |
| 781 | +        if (!$this->lexer->isNextToken(DocLexer::T_CLOSE_PARENTHESIS)) { | |
| 782 | 782 | $values = $this->Values(); | 
| 783 | 783 | } | 
| 784 | 784 | |
| @@ -806,7 +806,7 @@ discard block | ||
| 806 | 806 | $token = $this->lexer->lookahead; | 
| 807 | 807 | $value = $this->Value(); | 
| 808 | 808 | |
| 809 | -            if ( ! is_object($value) && ! is_array($value)) { | |
| 809 | +            if (!is_object($value) && !is_array($value)) { | |
| 810 | 810 |                  $this->syntaxError('Value', $token); | 
| 811 | 811 | } | 
| 812 | 812 | |
| @@ -816,10 +816,10 @@ discard block | ||
| 816 | 816 |          foreach ($values as $k => $value) { | 
| 817 | 817 |              if (is_object($value) && $value instanceof \stdClass) { | 
| 818 | 818 | $values[$value->name] = $value->value; | 
| 819 | -            } else if ( ! isset($values['value'])){ | |
| 819 | +            } else if (!isset($values['value'])) { | |
| 820 | 820 | $values['value'] = $value; | 
| 821 | 821 |              } else { | 
| 822 | -                if ( ! is_array($values['value'])) { | |
| 822 | +                if (!is_array($values['value'])) { | |
| 823 | 823 | $values['value'] = [$values['value']]; | 
| 824 | 824 | } | 
| 825 | 825 | |
| @@ -843,7 +843,7 @@ discard block | ||
| 843 | 843 |      { | 
| 844 | 844 | $identifier = $this->Identifier(); | 
| 845 | 845 | |
| 846 | -        if ( ! defined($identifier) && false !== strpos($identifier, '::') && '\\' !== $identifier[0]) { | |
| 846 | +        if (!defined($identifier) && false !== strpos($identifier, '::') && '\\' !== $identifier[0]) { | |
| 847 | 847 |              list($className, $const) = explode('::', $identifier); | 
| 848 | 848 | |
| 849 | 849 | $pos = strpos($className, '\\'); | 
| @@ -865,12 +865,12 @@ discard block | ||
| 865 | 865 | case isset($this->imports[$loweredAlias]): | 
| 866 | 866 | $found = true; | 
| 867 | 867 | $className = (false !== $pos) | 
| 868 | - ? $this->imports[$loweredAlias] . substr($className, $pos) | |
| 868 | + ? $this->imports[$loweredAlias].substr($className, $pos) | |
| 869 | 869 | : $this->imports[$loweredAlias]; | 
| 870 | 870 | break; | 
| 871 | 871 | |
| 872 | 872 | default: | 
| 873 | -                    if(isset($this->imports['__NAMESPACE__'])) { | |
| 873 | +                    if (isset($this->imports['__NAMESPACE__'])) { | |
| 874 | 874 | $ns = $this->imports['__NAMESPACE__']; | 
| 875 | 875 | |
| 876 | 876 |                          if (class_exists($ns.'\\'.$className) || interface_exists($ns.'\\'.$className)) { | 
| @@ -882,7 +882,7 @@ discard block | ||
| 882 | 882 | } | 
| 883 | 883 | |
| 884 | 884 |              if ($found) { | 
| 885 | - $identifier = $className . '::' . $const; | |
| 885 | + $identifier = $className.'::'.$const; | |
| 886 | 886 | } | 
| 887 | 887 | } | 
| 888 | 888 | |
| @@ -907,7 +907,7 @@ discard block | ||
| 907 | 907 | private function Identifier() | 
| 908 | 908 |      { | 
| 909 | 909 | // check if we have an annotation | 
| 910 | -        if ( ! $this->lexer->isNextTokenAny(self::$classIdentifiers)) { | |
| 910 | +        if (!$this->lexer->isNextTokenAny(self::$classIdentifiers)) { | |
| 911 | 911 |              $this->syntaxError('namespace separator or identifier'); | 
| 912 | 912 | } | 
| 913 | 913 | |
| @@ -921,7 +921,7 @@ discard block | ||
| 921 | 921 | $this->match(DocLexer::T_NAMESPACE_SEPARATOR); | 
| 922 | 922 | $this->matchAny(self::$classIdentifiers); | 
| 923 | 923 | |
| 924 | - $className .= '\\' . $this->lexer->token['value']; | |
| 924 | + $className .= '\\'.$this->lexer->token['value']; | |
| 925 | 925 | } | 
| 926 | 926 | |
| 927 | 927 | return $className; | 
| @@ -969,11 +969,11 @@ discard block | ||
| 969 | 969 | |
| 970 | 970 | case DocLexer::T_INTEGER: | 
| 971 | 971 | $this->match(DocLexer::T_INTEGER); | 
| 972 | - return (int)$this->lexer->token['value']; | |
| 972 | + return (int) $this->lexer->token['value']; | |
| 973 | 973 | |
| 974 | 974 | case DocLexer::T_FLOAT: | 
| 975 | 975 | $this->match(DocLexer::T_FLOAT); | 
| 976 | - return (float)$this->lexer->token['value']; | |
| 976 | + return (float) $this->lexer->token['value']; | |
| 977 | 977 | |
| 978 | 978 | case DocLexer::T_TRUE: | 
| 979 | 979 | $this->match(DocLexer::T_TRUE); | 
| @@ -1101,9 +1101,9 @@ discard block | ||
| 1101 | 1101 | } | 
| 1102 | 1102 | |
| 1103 | 1103 |          foreach (array_keys($this->ignoredAnnotationNamespaces) as $ignoredAnnotationNamespace) { | 
| 1104 | - $ignoredAnnotationNamespace = rtrim($ignoredAnnotationNamespace, '\\') . '\\'; | |
| 1104 | + $ignoredAnnotationNamespace = rtrim($ignoredAnnotationNamespace, '\\').'\\'; | |
| 1105 | 1105 | |
| 1106 | -            if (0 === stripos(rtrim($name, '\\') . '\\', $ignoredAnnotationNamespace)) { | |
| 1106 | +            if (0 === stripos(rtrim($name, '\\').'\\', $ignoredAnnotationNamespace)) { | |
| 1107 | 1107 | return true; | 
| 1108 | 1108 | } | 
| 1109 | 1109 | } |