@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | $namespace = preg_quote($class->getNamespaceName()); |
39 | - $content = preg_replace('/^.*?(\bnamespace\s+' . $namespace . '\s*[;{].*)$/s', '\\1', $content); |
|
40 | - $tokenizer = new TokenParser('<?php ' . $content); |
|
39 | + $content = preg_replace('/^.*?(\bnamespace\s+'.$namespace.'\s*[;{].*)$/s', '\\1', $content); |
|
40 | + $tokenizer = new TokenParser('<?php '.$content); |
|
41 | 41 | |
42 | 42 | $statements = $tokenizer->parseUseStatements($class->getNamespaceName()); |
43 | 43 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | private function getFileContent($filename, $lineNumber) |
56 | 56 | { |
57 | - if ( ! is_file($filename)) { |
|
57 | + if (!is_file($filename)) { |
|
58 | 58 | return null; |
59 | 59 | } |
60 | 60 |
@@ -57,13 +57,13 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function __construct(array $values) |
59 | 59 | { |
60 | - if (!isset($values['value'])){ |
|
60 | + if (!isset($values['value'])) { |
|
61 | 61 | $values['value'] = null; |
62 | 62 | } |
63 | - if (is_string($values['value'])){ |
|
63 | + if (is_string($values['value'])) { |
|
64 | 64 | $values['value'] = [$values['value']]; |
65 | 65 | } |
66 | - if (!is_array($values['value'])){ |
|
66 | + if (!is_array($values['value'])) { |
|
67 | 67 | throw new \InvalidArgumentException( |
68 | 68 | sprintf('@Target expects either a string value, or an array of strings, "%s" given.', |
69 | 69 | is_object($values['value']) ? get_class($values['value']) : gettype($values['value']) |
@@ -73,10 +73,10 @@ discard block |
||
73 | 73 | |
74 | 74 | $bitmask = 0; |
75 | 75 | foreach ($values['value'] as $literal) { |
76 | - if(!isset(self::$map[$literal])){ |
|
76 | + if (!isset(self::$map[$literal])) { |
|
77 | 77 | throw new \InvalidArgumentException( |
78 | 78 | sprintf('Invalid Target "%s". Available targets: [%s]', |
79 | - $literal, implode(', ', array_keys(self::$map))) |
|
79 | + $literal, implode(', ', array_keys(self::$map))) |
|
80 | 80 | ); |
81 | 81 | } |
82 | 82 | $bitmask |= self::$map[$literal]; |
@@ -38,12 +38,12 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function __construct(array $values) |
40 | 40 | { |
41 | - if ( ! isset($values['literal'])) { |
|
41 | + if (!isset($values['literal'])) { |
|
42 | 42 | $values['literal'] = []; |
43 | 43 | } |
44 | 44 | |
45 | 45 | foreach ($values['value'] as $var) { |
46 | - if( ! is_scalar($var)) { |
|
46 | + if (!is_scalar($var)) { |
|
47 | 47 | throw new \InvalidArgumentException(sprintf( |
48 | 48 | '@Enum supports only scalar values "%s" given.', |
49 | 49 | is_object($var) ? get_class($var) : gettype($var) |
@@ -52,10 +52,10 @@ discard block |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | foreach ($values['literal'] as $key => $var) { |
55 | - if( ! in_array($key, $values['value'])) { |
|
55 | + if (!in_array($key, $values['value'])) { |
|
56 | 56 | throw new \InvalidArgumentException(sprintf( |
57 | 57 | 'Undefined enumerator value "%s" for literal "%s".', |
58 | - $key , $var |
|
58 | + $key, $var |
|
59 | 59 | )); |
60 | 60 | } |
61 | 61 | } |
@@ -99,17 +99,17 @@ |
||
99 | 99 | $explicitAlias = true; |
100 | 100 | $alias = ''; |
101 | 101 | } else if ($token === ',') { |
102 | - $statements[strtolower($alias)] = $groupRoot . $class; |
|
102 | + $statements[strtolower($alias)] = $groupRoot.$class; |
|
103 | 103 | $class = ''; |
104 | 104 | $alias = ''; |
105 | 105 | $explicitAlias = false; |
106 | 106 | } else if ($token === ';') { |
107 | - $statements[strtolower($alias)] = $groupRoot . $class; |
|
107 | + $statements[strtolower($alias)] = $groupRoot.$class; |
|
108 | 108 | break; |
109 | - } else if ($token === '{' ) { |
|
109 | + } else if ($token === '{') { |
|
110 | 110 | $groupRoot = $class; |
111 | 111 | $class = ''; |
112 | - } else if ($token === '}' ) { |
|
112 | + } else if ($token === '}') { |
|
113 | 113 | continue; |
114 | 114 | } else { |
115 | 115 | break; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | public static function syntaxError($message) |
24 | 24 | { |
25 | - return new self('[Syntax Error] ' . $message); |
|
25 | + return new self('[Syntax Error] '.$message); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public static function semanticalError($message) |
36 | 36 | { |
37 | - return new self('[Semantical Error] ' . $message); |
|
37 | + return new self('[Semantical Error] '.$message); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public static function creationError($message) |
51 | 51 | { |
52 | - return new self('[Creation Error] ' . $message); |
|
52 | + return new self('[Creation Error] '.$message); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public static function typeError($message) |
65 | 65 | { |
66 | - return new self('[Type Error] ' . $message); |
|
66 | + return new self('[Type Error] '.$message); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | return self::semanticalError(sprintf( |
82 | 82 | "Couldn't find constant %s%s.", |
83 | 83 | $identifier, |
84 | - $context ? ', ' . $context : '' |
|
84 | + $context ? ', '.$context : '' |
|
85 | 85 | )); |
86 | 86 | } |
87 | 87 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $annotationName, |
107 | 107 | $context, |
108 | 108 | $expected, |
109 | - is_object($actual) ? 'an instance of ' . get_class($actual) : gettype($actual) |
|
109 | + is_object($actual) ? 'an instance of '.get_class($actual) : gettype($actual) |
|
110 | 110 | )); |
111 | 111 | } |
112 | 112 |
@@ -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) { |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | } |
521 | 521 | |
522 | 522 | // Checks if the property has type[] |
523 | - if (false !== $pos = strrpos($type, '[')) { |
|
523 | + if (false !== $pos = strrpos($type, '[')) { |
|
524 | 524 | $arrayType = substr($type, 0, $pos); |
525 | 525 | |
526 | 526 | return $metadata->withType([ |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | if (($this->annotationMetadata[$name]->getTarget()->unwrap() & $target) === 0 && $target) { |
670 | 670 | throw AnnotationException::semanticalError( |
671 | 671 | sprintf('Annotation @%s is not allowed to be declared on %s. You may only use this annotation on these code elements: %s.', |
672 | - $originalName, $this->context, $this->annotationMetadata[$name]->getTarget()->describe()) |
|
672 | + $originalName, $this->context, $this->annotationMetadata[$name]->getTarget()->describe()) |
|
673 | 673 | ); |
674 | 674 | } |
675 | 675 | |
@@ -854,9 +854,9 @@ discard block |
||
854 | 854 | case !empty ($this->namespaces): |
855 | 855 | foreach ($this->namespaces as $ns) { |
856 | 856 | if (class_exists($ns.'\\'.$className) || interface_exists($ns.'\\'.$className)) { |
857 | - $className = $ns.'\\'.$className; |
|
858 | - $found = true; |
|
859 | - break; |
|
857 | + $className = $ns.'\\'.$className; |
|
858 | + $found = true; |
|
859 | + break; |
|
860 | 860 | } |
861 | 861 | } |
862 | 862 | break; |
@@ -881,7 +881,7 @@ discard block |
||
881 | 881 | } |
882 | 882 | |
883 | 883 | if ($found) { |
884 | - $identifier = $className . '::' . $const; |
|
884 | + $identifier = $className . '::' . $const; |
|
885 | 885 | } |
886 | 886 | } |
887 | 887 |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | */ |
301 | 301 | private function match($token) |
302 | 302 | { |
303 | - if ( ! $this->lexer->isNextToken($token) ) { |
|
303 | + if (!$this->lexer->isNextToken($token)) { |
|
304 | 304 | $this->syntaxError($this->lexer->getLiteral($token)); |
305 | 305 | } |
306 | 306 | |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | */ |
320 | 320 | private function matchAny(array $tokens) |
321 | 321 | { |
322 | - if ( ! $this->lexer->isNextTokenAny($tokens)) { |
|
322 | + if (!$this->lexer->isNextTokenAny($tokens)) { |
|
323 | 323 | $this->syntaxError(implode(' or ', array_map([$this->lexer, 'getLiteral'], $tokens))); |
324 | 324 | } |
325 | 325 | |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | : sprintf("'%s' at position %s", $token['value'], $token['position']); |
349 | 349 | |
350 | 350 | if (strlen($this->context)) { |
351 | - $message .= ' in ' . $this->context; |
|
351 | + $message .= ' in '.$this->context; |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | $message .= '.'; |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | |
415 | 415 | self::$metadataParser->setTarget(Target::TARGET_CLASS); |
416 | 416 | |
417 | - foreach (self::$metadataParser->parse($docComment, 'class @' . $name) as $annotation) { |
|
417 | + foreach (self::$metadataParser->parse($docComment, 'class @'.$name) as $annotation) { |
|
418 | 418 | if ($annotation instanceof Target) { |
419 | 419 | $annotationBuilder = $annotationBuilder->withTarget(AnnotationTarget::fromAnnotation($annotation)); |
420 | 420 | |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | } |
432 | 432 | |
433 | 433 | // if there is no constructor we will inject values into public properties |
434 | - if (! $useConstructor) { |
|
434 | + if (!$useConstructor) { |
|
435 | 435 | // collect all public properties |
436 | 436 | foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC) as $i => $property) { |
437 | 437 | $propertyBuilder = new PropertyMetadataBuilder($property->getName()); |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | $attribute = new Attribute(); |
452 | 452 | $attribute->required = (false !== strpos($propertyComment, '@Required')); |
453 | 453 | $attribute->name = $property->name; |
454 | - $attribute->type = (false !== strpos($propertyComment, '@var') && preg_match('/@var\s+([^\s]+)/',$propertyComment, $matches)) |
|
454 | + $attribute->type = (false !== strpos($propertyComment, '@var') && preg_match('/@var\s+([^\s]+)/', $propertyComment, $matches)) |
|
455 | 455 | ? $matches[1] |
456 | 456 | : 'mixed'; |
457 | 457 | |
@@ -459,18 +459,18 @@ discard block |
||
459 | 459 | |
460 | 460 | // checks if the property has @Enum |
461 | 461 | if (false !== strpos($propertyComment, '@Enum')) { |
462 | - $context = 'property ' . $class->name . "::\$" . $property->name; |
|
462 | + $context = 'property '.$class->name."::\$".$property->name; |
|
463 | 463 | |
464 | 464 | self::$metadataParser->setTarget(Target::TARGET_PROPERTY); |
465 | 465 | |
466 | 466 | foreach (self::$metadataParser->parse($propertyComment, $context) as $annotation) { |
467 | - if ( ! $annotation instanceof Enum) { |
|
467 | + if (!$annotation instanceof Enum) { |
|
468 | 468 | continue; |
469 | 469 | } |
470 | 470 | |
471 | 471 | $propertyBuilder = $propertyBuilder->withEnum([ |
472 | 472 | 'value' => $annotation->value, |
473 | - 'literal' => ( ! empty($annotation->literal)) |
|
473 | + 'literal' => (!empty($annotation->literal)) |
|
474 | 474 | ? $annotation->literal |
475 | 475 | : $annotation->value, |
476 | 476 | ]); |
@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | |
599 | 599 | if ('\\' !== $name[0]) { |
600 | 600 | $pos = strpos($name, '\\'); |
601 | - $alias = (false === $pos)? $name : substr($name, 0, $pos); |
|
601 | + $alias = (false === $pos) ? $name : substr($name, 0, $pos); |
|
602 | 602 | $found = false; |
603 | 603 | $loweredAlias = strtolower($alias); |
604 | 604 | |
@@ -613,19 +613,19 @@ discard block |
||
613 | 613 | } elseif (isset($this->imports[$loweredAlias])) { |
614 | 614 | $found = true; |
615 | 615 | $name = (false !== $pos) |
616 | - ? $this->imports[$loweredAlias] . substr($name, $pos) |
|
616 | + ? $this->imports[$loweredAlias].substr($name, $pos) |
|
617 | 617 | : $this->imports[$loweredAlias]; |
618 | - } elseif ( ! isset($this->ignoredAnnotationNames[$name]) |
|
618 | + } elseif (!isset($this->ignoredAnnotationNames[$name]) |
|
619 | 619 | && isset($this->imports['__NAMESPACE__']) |
620 | - && $this->classExists($this->imports['__NAMESPACE__'] . '\\' . $name) |
|
620 | + && $this->classExists($this->imports['__NAMESPACE__'].'\\'.$name) |
|
621 | 621 | ) { |
622 | 622 | $name = $this->imports['__NAMESPACE__'].'\\'.$name; |
623 | 623 | $found = true; |
624 | - } elseif (! isset($this->ignoredAnnotationNames[$name]) && $this->classExists($name)) { |
|
624 | + } elseif (!isset($this->ignoredAnnotationNames[$name]) && $this->classExists($name)) { |
|
625 | 625 | $found = true; |
626 | 626 | } |
627 | 627 | |
628 | - if ( ! $found) { |
|
628 | + if (!$found) { |
|
629 | 629 | if ($this->isIgnoredAnnotation($name)) { |
630 | 630 | return false; |
631 | 631 | } |
@@ -634,9 +634,9 @@ discard block |
||
634 | 634 | } |
635 | 635 | } |
636 | 636 | |
637 | - $name = ltrim($name,'\\'); |
|
637 | + $name = ltrim($name, '\\'); |
|
638 | 638 | |
639 | - if ( ! $this->classExists($name)) { |
|
639 | + if (!$this->classExists($name)) { |
|
640 | 640 | throw AnnotationException::semanticalError(sprintf('The annotation "@%s" in %s does not exist, or could not be auto-loaded.', $name, $this->context)); |
641 | 641 | } |
642 | 642 | |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | |
647 | 647 | |
648 | 648 | // collects the metadata annotation only if there is not yet |
649 | - if (! isset($this->annotationMetadata[$name]) && ! array_key_exists($name, $this->nonAnnotationClasses)) { |
|
649 | + if (!isset($this->annotationMetadata[$name]) && !array_key_exists($name, $this->nonAnnotationClasses)) { |
|
650 | 650 | $this->collectAnnotationMetadata($name); |
651 | 651 | } |
652 | 652 | |
@@ -681,7 +681,7 @@ discard block |
||
681 | 681 | $enum = $property->getEnum(); |
682 | 682 | |
683 | 683 | // checks if the attribute is a valid enumerator |
684 | - if ($enum !== null && isset($values[$propertyName]) && ! in_array($values[$propertyName], $enum['value'])) { |
|
684 | + if ($enum !== null && isset($values[$propertyName]) && !in_array($values[$propertyName], $enum['value'])) { |
|
685 | 685 | throw AnnotationException::enumeratorError($propertyName, $name, $this->context, $enum['literal'], $values[$propertyName]); |
686 | 686 | } |
687 | 687 | } |
@@ -697,9 +697,9 @@ discard block |
||
697 | 697 | } |
698 | 698 | |
699 | 699 | // handle a not given attribute or null value |
700 | - if (! isset($values[$valueName])) { |
|
700 | + if (!isset($values[$valueName])) { |
|
701 | 701 | if ($property->isRequired()) { |
702 | - throw AnnotationException::requiredError($propertyName, $originalName, $this->context, 'a(n) ' . $type['value']); |
|
702 | + throw AnnotationException::requiredError($propertyName, $originalName, $this->context, 'a(n) '.$type['value']); |
|
703 | 703 | } |
704 | 704 | |
705 | 705 | continue; |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | |
708 | 708 | if ($type !== null && $type['type'] === 'array') { |
709 | 709 | // handle the case of a single value |
710 | - if ( ! is_array($values[$valueName])) { |
|
710 | + if (!is_array($values[$valueName])) { |
|
711 | 711 | $values[$valueName] = [$values[$valueName]]; |
712 | 712 | } |
713 | 713 | |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | $instance = new $name(); |
734 | 734 | |
735 | 735 | foreach ($values as $property => $value) { |
736 | - if (! isset($this->annotationMetadata[$name]->getProperties()[$property])) { |
|
736 | + if (!isset($this->annotationMetadata[$name]->getProperties()[$property])) { |
|
737 | 737 | if ('value' !== $property) { |
738 | 738 | throw AnnotationException::creationError( |
739 | 739 | sprintf( |
@@ -771,13 +771,13 @@ discard block |
||
771 | 771 | { |
772 | 772 | $values = []; |
773 | 773 | |
774 | - if ( ! $this->lexer->isNextToken(DocLexer::T_OPEN_PARENTHESIS)) { |
|
774 | + if (!$this->lexer->isNextToken(DocLexer::T_OPEN_PARENTHESIS)) { |
|
775 | 775 | return $values; |
776 | 776 | } |
777 | 777 | |
778 | 778 | $this->match(DocLexer::T_OPEN_PARENTHESIS); |
779 | 779 | |
780 | - if ( ! $this->lexer->isNextToken(DocLexer::T_CLOSE_PARENTHESIS)) { |
|
780 | + if (!$this->lexer->isNextToken(DocLexer::T_CLOSE_PARENTHESIS)) { |
|
781 | 781 | $values = $this->Values(); |
782 | 782 | } |
783 | 783 | |
@@ -805,7 +805,7 @@ discard block |
||
805 | 805 | $token = $this->lexer->lookahead; |
806 | 806 | $value = $this->Value(); |
807 | 807 | |
808 | - if ( ! is_object($value) && ! is_array($value)) { |
|
808 | + if (!is_object($value) && !is_array($value)) { |
|
809 | 809 | $this->syntaxError('Value', $token); |
810 | 810 | } |
811 | 811 | |
@@ -815,10 +815,10 @@ discard block |
||
815 | 815 | foreach ($values as $k => $value) { |
816 | 816 | if (is_object($value) && $value instanceof \stdClass) { |
817 | 817 | $values[$value->name] = $value->value; |
818 | - } else if ( ! isset($values['value'])){ |
|
818 | + } else if (!isset($values['value'])) { |
|
819 | 819 | $values['value'] = $value; |
820 | 820 | } else { |
821 | - if ( ! is_array($values['value'])) { |
|
821 | + if (!is_array($values['value'])) { |
|
822 | 822 | $values['value'] = [$values['value']]; |
823 | 823 | } |
824 | 824 | |
@@ -842,7 +842,7 @@ discard block |
||
842 | 842 | { |
843 | 843 | $identifier = $this->Identifier(); |
844 | 844 | |
845 | - if ( ! defined($identifier) && false !== strpos($identifier, '::') && '\\' !== $identifier[0]) { |
|
845 | + if (!defined($identifier) && false !== strpos($identifier, '::') && '\\' !== $identifier[0]) { |
|
846 | 846 | list($className, $const) = explode('::', $identifier); |
847 | 847 | |
848 | 848 | $pos = strpos($className, '\\'); |
@@ -864,12 +864,12 @@ discard block |
||
864 | 864 | case isset($this->imports[$loweredAlias]): |
865 | 865 | $found = true; |
866 | 866 | $className = (false !== $pos) |
867 | - ? $this->imports[$loweredAlias] . substr($className, $pos) |
|
867 | + ? $this->imports[$loweredAlias].substr($className, $pos) |
|
868 | 868 | : $this->imports[$loweredAlias]; |
869 | 869 | break; |
870 | 870 | |
871 | 871 | default: |
872 | - if(isset($this->imports['__NAMESPACE__'])) { |
|
872 | + if (isset($this->imports['__NAMESPACE__'])) { |
|
873 | 873 | $ns = $this->imports['__NAMESPACE__']; |
874 | 874 | |
875 | 875 | if (class_exists($ns.'\\'.$className) || interface_exists($ns.'\\'.$className)) { |
@@ -881,7 +881,7 @@ discard block |
||
881 | 881 | } |
882 | 882 | |
883 | 883 | if ($found) { |
884 | - $identifier = $className . '::' . $const; |
|
884 | + $identifier = $className.'::'.$const; |
|
885 | 885 | } |
886 | 886 | } |
887 | 887 | |
@@ -906,7 +906,7 @@ discard block |
||
906 | 906 | private function Identifier() |
907 | 907 | { |
908 | 908 | // check if we have an annotation |
909 | - if ( ! $this->lexer->isNextTokenAny(self::$classIdentifiers)) { |
|
909 | + if (!$this->lexer->isNextTokenAny(self::$classIdentifiers)) { |
|
910 | 910 | $this->syntaxError('namespace separator or identifier'); |
911 | 911 | } |
912 | 912 | |
@@ -920,7 +920,7 @@ discard block |
||
920 | 920 | $this->match(DocLexer::T_NAMESPACE_SEPARATOR); |
921 | 921 | $this->matchAny(self::$classIdentifiers); |
922 | 922 | |
923 | - $className .= '\\' . $this->lexer->token['value']; |
|
923 | + $className .= '\\'.$this->lexer->token['value']; |
|
924 | 924 | } |
925 | 925 | |
926 | 926 | return $className; |
@@ -968,11 +968,11 @@ discard block |
||
968 | 968 | |
969 | 969 | case DocLexer::T_INTEGER: |
970 | 970 | $this->match(DocLexer::T_INTEGER); |
971 | - return (int)$this->lexer->token['value']; |
|
971 | + return (int) $this->lexer->token['value']; |
|
972 | 972 | |
973 | 973 | case DocLexer::T_FLOAT: |
974 | 974 | $this->match(DocLexer::T_FLOAT); |
975 | - return (float)$this->lexer->token['value']; |
|
975 | + return (float) $this->lexer->token['value']; |
|
976 | 976 | |
977 | 977 | case DocLexer::T_TRUE: |
978 | 978 | $this->match(DocLexer::T_TRUE); |
@@ -1100,9 +1100,9 @@ discard block |
||
1100 | 1100 | } |
1101 | 1101 | |
1102 | 1102 | foreach (array_keys($this->ignoredAnnotationNamespaces) as $ignoredAnnotationNamespace) { |
1103 | - $ignoredAnnotationNamespace = rtrim($ignoredAnnotationNamespace, '\\') . '\\'; |
|
1103 | + $ignoredAnnotationNamespace = rtrim($ignoredAnnotationNamespace, '\\').'\\'; |
|
1104 | 1104 | |
1105 | - if (0 === stripos(rtrim($name, '\\') . '\\', $ignoredAnnotationNamespace)) { |
|
1105 | + if (0 === stripos(rtrim($name, '\\').'\\', $ignoredAnnotationNamespace)) { |
|
1106 | 1106 | return true; |
1107 | 1107 | } |
1108 | 1108 | } |
@@ -102,7 +102,7 @@ |
||
102 | 102 | ', ', |
103 | 103 | array_filter( |
104 | 104 | self::LABELS, |
105 | - function (int $target) : bool { |
|
105 | + function(int $target) : bool { |
|
106 | 106 | return ($this->target & $target) === $target; |
107 | 107 | }, |
108 | 108 | 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 | ) |