@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | 'array_type'=>'string', |
| 136 | 136 | 'value' =>'array<string>' |
| 137 | 137 | ] |
| 138 | - ], |
|
| 138 | + ], |
|
| 139 | 139 | ], |
| 140 | 140 | 'Doctrine\Annotations\Annotation\Attribute' => [ |
| 141 | 141 | 'is_annotation' => true, |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | 'type' =>'boolean', |
| 165 | 165 | 'value' =>'boolean' |
| 166 | 166 | ] |
| 167 | - ], |
|
| 167 | + ], |
|
| 168 | 168 | ], |
| 169 | 169 | 'Doctrine\Annotations\Annotation\Attributes' => [ |
| 170 | 170 | 'is_annotation' => true, |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | 'array_type'=>'Doctrine\Annotations\Annotation\Attribute', |
| 183 | 183 | 'value' =>'array<Doctrine\Annotations\Annotation\Attribute>' |
| 184 | 184 | ] |
| 185 | - ], |
|
| 185 | + ], |
|
| 186 | 186 | ], |
| 187 | 187 | 'Doctrine\Annotations\Annotation\Enum' => [ |
| 188 | 188 | 'is_annotation' => true, |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | 'type' => 'array', |
| 203 | 203 | 'required' => false, |
| 204 | 204 | ], |
| 205 | - ], |
|
| 205 | + ], |
|
| 206 | 206 | ], |
| 207 | 207 | ]; |
| 208 | 208 | |
@@ -733,7 +733,7 @@ discard block |
||
| 733 | 733 | if (0 === (self::$annotationMetadata[$name]['targets'] & $target) && $target) { |
| 734 | 734 | throw AnnotationException::semanticalError( |
| 735 | 735 | sprintf('Annotation @%s is not allowed to be declared on %s. You may only use this annotation on these code elements: %s.', |
| 736 | - $originalName, $this->context, self::$annotationMetadata[$name]['targets_literal']) |
|
| 736 | + $originalName, $this->context, self::$annotationMetadata[$name]['targets_literal']) |
|
| 737 | 737 | ); |
| 738 | 738 | } |
| 739 | 739 | |
@@ -902,9 +902,9 @@ discard block |
||
| 902 | 902 | case !empty ($this->namespaces): |
| 903 | 903 | foreach ($this->namespaces as $ns) { |
| 904 | 904 | if (class_exists($ns.'\\'.$className) || interface_exists($ns.'\\'.$className)) { |
| 905 | - $className = $ns.'\\'.$className; |
|
| 906 | - $found = true; |
|
| 907 | - break; |
|
| 905 | + $className = $ns.'\\'.$className; |
|
| 906 | + $found = true; |
|
| 907 | + break; |
|
| 908 | 908 | } |
| 909 | 909 | } |
| 910 | 910 | break; |
@@ -929,7 +929,7 @@ discard block |
||
| 929 | 929 | } |
| 930 | 930 | |
| 931 | 931 | if ($found) { |
| 932 | - $identifier = $className . '::' . $const; |
|
| 932 | + $identifier = $className . '::' . $const; |
|
| 933 | 933 | } |
| 934 | 934 | } |
| 935 | 935 | |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | */ |
| 374 | 374 | private function match($token) |
| 375 | 375 | { |
| 376 | - if ( ! $this->lexer->isNextToken($token) ) { |
|
| 376 | + if (!$this->lexer->isNextToken($token)) { |
|
| 377 | 377 | $this->syntaxError($this->lexer->getLiteral($token)); |
| 378 | 378 | } |
| 379 | 379 | |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | */ |
| 393 | 393 | private function matchAny(array $tokens) |
| 394 | 394 | { |
| 395 | - if ( ! $this->lexer->isNextTokenAny($tokens)) { |
|
| 395 | + if (!$this->lexer->isNextTokenAny($tokens)) { |
|
| 396 | 396 | $this->syntaxError(implode(' or ', array_map([$this->lexer, 'getLiteral'], $tokens))); |
| 397 | 397 | } |
| 398 | 398 | |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | : sprintf("'%s' at position %s", $token['value'], $token['position']); |
| 422 | 422 | |
| 423 | 423 | if (strlen($this->context)) { |
| 424 | - $message .= ' in ' . $this->context; |
|
| 424 | + $message .= ' in '.$this->context; |
|
| 425 | 425 | } |
| 426 | 426 | |
| 427 | 427 | $message .= '.'; |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | if ($metadata['is_annotation']) { |
| 488 | 488 | self::$metadataParser->setTarget(Target::TARGET_CLASS); |
| 489 | 489 | |
| 490 | - foreach (self::$metadataParser->parse($docComment, 'class @' . $name) as $annotation) { |
|
| 490 | + foreach (self::$metadataParser->parse($docComment, 'class @'.$name) as $annotation) { |
|
| 491 | 491 | if ($annotation instanceof Target) { |
| 492 | 492 | $metadata['targets'] = $annotation->targets; |
| 493 | 493 | $metadata['targets_literal'] = $annotation->literal; |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | |
| 517 | 517 | $attribute->required = (false !== strpos($propertyComment, '@Required')); |
| 518 | 518 | $attribute->name = $property->name; |
| 519 | - $attribute->type = (false !== strpos($propertyComment, '@var') && preg_match('/@var\s+([^\s]+)/',$propertyComment, $matches)) |
|
| 519 | + $attribute->type = (false !== strpos($propertyComment, '@var') && preg_match('/@var\s+([^\s]+)/', $propertyComment, $matches)) |
|
| 520 | 520 | ? $matches[1] |
| 521 | 521 | : 'mixed'; |
| 522 | 522 | |
@@ -524,17 +524,17 @@ discard block |
||
| 524 | 524 | |
| 525 | 525 | // checks if the property has @Enum |
| 526 | 526 | if (false !== strpos($propertyComment, '@Enum')) { |
| 527 | - $context = 'property ' . $class->name . "::\$" . $property->name; |
|
| 527 | + $context = 'property '.$class->name."::\$".$property->name; |
|
| 528 | 528 | |
| 529 | 529 | self::$metadataParser->setTarget(Target::TARGET_PROPERTY); |
| 530 | 530 | |
| 531 | 531 | foreach (self::$metadataParser->parse($propertyComment, $context) as $annotation) { |
| 532 | - if ( ! $annotation instanceof Enum) { |
|
| 532 | + if (!$annotation instanceof Enum) { |
|
| 533 | 533 | continue; |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 | $metadata['enum'][$property->name]['value'] = $annotation->value; |
| 537 | - $metadata['enum'][$property->name]['literal'] = ( ! empty($annotation->literal)) |
|
| 537 | + $metadata['enum'][$property->name]['literal'] = (!empty($annotation->literal)) |
|
| 538 | 538 | ? $annotation->literal |
| 539 | 539 | : $annotation->value; |
| 540 | 540 | } |
@@ -662,7 +662,7 @@ discard block |
||
| 662 | 662 | |
| 663 | 663 | if ('\\' !== $name[0]) { |
| 664 | 664 | $pos = strpos($name, '\\'); |
| 665 | - $alias = (false === $pos)? $name : substr($name, 0, $pos); |
|
| 665 | + $alias = (false === $pos) ? $name : substr($name, 0, $pos); |
|
| 666 | 666 | $found = false; |
| 667 | 667 | $loweredAlias = strtolower($alias); |
| 668 | 668 | |
@@ -677,19 +677,19 @@ discard block |
||
| 677 | 677 | } elseif (isset($this->imports[$loweredAlias])) { |
| 678 | 678 | $found = true; |
| 679 | 679 | $name = (false !== $pos) |
| 680 | - ? $this->imports[$loweredAlias] . substr($name, $pos) |
|
| 680 | + ? $this->imports[$loweredAlias].substr($name, $pos) |
|
| 681 | 681 | : $this->imports[$loweredAlias]; |
| 682 | - } elseif ( ! isset($this->ignoredAnnotationNames[$name]) |
|
| 682 | + } elseif (!isset($this->ignoredAnnotationNames[$name]) |
|
| 683 | 683 | && isset($this->imports['__NAMESPACE__']) |
| 684 | - && $this->classExists($this->imports['__NAMESPACE__'] . '\\' . $name) |
|
| 684 | + && $this->classExists($this->imports['__NAMESPACE__'].'\\'.$name) |
|
| 685 | 685 | ) { |
| 686 | 686 | $name = $this->imports['__NAMESPACE__'].'\\'.$name; |
| 687 | 687 | $found = true; |
| 688 | - } elseif (! isset($this->ignoredAnnotationNames[$name]) && $this->classExists($name)) { |
|
| 688 | + } elseif (!isset($this->ignoredAnnotationNames[$name]) && $this->classExists($name)) { |
|
| 689 | 689 | $found = true; |
| 690 | 690 | } |
| 691 | 691 | |
| 692 | - if ( ! $found) { |
|
| 692 | + if (!$found) { |
|
| 693 | 693 | if ($this->isIgnoredAnnotation($name)) { |
| 694 | 694 | return false; |
| 695 | 695 | } |
@@ -698,9 +698,9 @@ discard block |
||
| 698 | 698 | } |
| 699 | 699 | } |
| 700 | 700 | |
| 701 | - $name = ltrim($name,'\\'); |
|
| 701 | + $name = ltrim($name, '\\'); |
|
| 702 | 702 | |
| 703 | - if ( ! $this->classExists($name)) { |
|
| 703 | + if (!$this->classExists($name)) { |
|
| 704 | 704 | throw AnnotationException::semanticalError(sprintf('The annotation "@%s" in %s does not exist, or could not be auto-loaded.', $name, $this->context)); |
| 705 | 705 | } |
| 706 | 706 | |
@@ -710,7 +710,7 @@ discard block |
||
| 710 | 710 | |
| 711 | 711 | |
| 712 | 712 | // collects the metadata annotation only if there is not yet |
| 713 | - if ( ! isset(self::$annotationMetadata[$name])) { |
|
| 713 | + if (!isset(self::$annotationMetadata[$name])) { |
|
| 714 | 714 | $this->collectAnnotationMetadata($name); |
| 715 | 715 | } |
| 716 | 716 | |
@@ -743,7 +743,7 @@ discard block |
||
| 743 | 743 | // checks all declared attributes |
| 744 | 744 | foreach (self::$annotationMetadata[$name]['enum'] as $property => $enum) { |
| 745 | 745 | // checks if the attribute is a valid enumerator |
| 746 | - if (isset($values[$property]) && ! in_array($values[$property], $enum['value'])) { |
|
| 746 | + if (isset($values[$property]) && !in_array($values[$property], $enum['value'])) { |
|
| 747 | 747 | throw AnnotationException::enumeratorError($property, $name, $this->context, $enum['literal'], $values[$property]); |
| 748 | 748 | } |
| 749 | 749 | } |
@@ -767,7 +767,7 @@ discard block |
||
| 767 | 767 | |
| 768 | 768 | if ($type['type'] === 'array') { |
| 769 | 769 | // handle the case of a single value |
| 770 | - if ( ! is_array($values[$property])) { |
|
| 770 | + if (!is_array($values[$property])) { |
|
| 771 | 771 | $values[$property] = [$values[$property]]; |
| 772 | 772 | } |
| 773 | 773 | |
@@ -799,7 +799,7 @@ discard block |
||
| 799 | 799 | } |
| 800 | 800 | |
| 801 | 801 | // handle the case if the property has no annotations |
| 802 | - if ( ! $property = self::$annotationMetadata[$name]['default_property']) { |
|
| 802 | + if (!$property = self::$annotationMetadata[$name]['default_property']) { |
|
| 803 | 803 | throw AnnotationException::creationError(sprintf('The annotation @%s declared on %s does not accept any values, but got %s.', $originalName, $this->context, json_encode($values))); |
| 804 | 804 | } |
| 805 | 805 | } |
@@ -819,13 +819,13 @@ discard block |
||
| 819 | 819 | { |
| 820 | 820 | $values = []; |
| 821 | 821 | |
| 822 | - if ( ! $this->lexer->isNextToken(DocLexer::T_OPEN_PARENTHESIS)) { |
|
| 822 | + if (!$this->lexer->isNextToken(DocLexer::T_OPEN_PARENTHESIS)) { |
|
| 823 | 823 | return $values; |
| 824 | 824 | } |
| 825 | 825 | |
| 826 | 826 | $this->match(DocLexer::T_OPEN_PARENTHESIS); |
| 827 | 827 | |
| 828 | - if ( ! $this->lexer->isNextToken(DocLexer::T_CLOSE_PARENTHESIS)) { |
|
| 828 | + if (!$this->lexer->isNextToken(DocLexer::T_CLOSE_PARENTHESIS)) { |
|
| 829 | 829 | $values = $this->Values(); |
| 830 | 830 | } |
| 831 | 831 | |
@@ -853,7 +853,7 @@ discard block |
||
| 853 | 853 | $token = $this->lexer->lookahead; |
| 854 | 854 | $value = $this->Value(); |
| 855 | 855 | |
| 856 | - if ( ! is_object($value) && ! is_array($value)) { |
|
| 856 | + if (!is_object($value) && !is_array($value)) { |
|
| 857 | 857 | $this->syntaxError('Value', $token); |
| 858 | 858 | } |
| 859 | 859 | |
@@ -863,10 +863,10 @@ discard block |
||
| 863 | 863 | foreach ($values as $k => $value) { |
| 864 | 864 | if (is_object($value) && $value instanceof \stdClass) { |
| 865 | 865 | $values[$value->name] = $value->value; |
| 866 | - } else if ( ! isset($values['value'])){ |
|
| 866 | + } else if (!isset($values['value'])) { |
|
| 867 | 867 | $values['value'] = $value; |
| 868 | 868 | } else { |
| 869 | - if ( ! is_array($values['value'])) { |
|
| 869 | + if (!is_array($values['value'])) { |
|
| 870 | 870 | $values['value'] = [$values['value']]; |
| 871 | 871 | } |
| 872 | 872 | |
@@ -890,7 +890,7 @@ discard block |
||
| 890 | 890 | { |
| 891 | 891 | $identifier = $this->Identifier(); |
| 892 | 892 | |
| 893 | - if ( ! defined($identifier) && false !== strpos($identifier, '::') && '\\' !== $identifier[0]) { |
|
| 893 | + if (!defined($identifier) && false !== strpos($identifier, '::') && '\\' !== $identifier[0]) { |
|
| 894 | 894 | list($className, $const) = explode('::', $identifier); |
| 895 | 895 | |
| 896 | 896 | $pos = strpos($className, '\\'); |
@@ -912,12 +912,12 @@ discard block |
||
| 912 | 912 | case isset($this->imports[$loweredAlias]): |
| 913 | 913 | $found = true; |
| 914 | 914 | $className = (false !== $pos) |
| 915 | - ? $this->imports[$loweredAlias] . substr($className, $pos) |
|
| 915 | + ? $this->imports[$loweredAlias].substr($className, $pos) |
|
| 916 | 916 | : $this->imports[$loweredAlias]; |
| 917 | 917 | break; |
| 918 | 918 | |
| 919 | 919 | default: |
| 920 | - if(isset($this->imports['__NAMESPACE__'])) { |
|
| 920 | + if (isset($this->imports['__NAMESPACE__'])) { |
|
| 921 | 921 | $ns = $this->imports['__NAMESPACE__']; |
| 922 | 922 | |
| 923 | 923 | if (class_exists($ns.'\\'.$className) || interface_exists($ns.'\\'.$className)) { |
@@ -929,7 +929,7 @@ discard block |
||
| 929 | 929 | } |
| 930 | 930 | |
| 931 | 931 | if ($found) { |
| 932 | - $identifier = $className . '::' . $const; |
|
| 932 | + $identifier = $className.'::'.$const; |
|
| 933 | 933 | } |
| 934 | 934 | } |
| 935 | 935 | |
@@ -954,7 +954,7 @@ discard block |
||
| 954 | 954 | private function Identifier() |
| 955 | 955 | { |
| 956 | 956 | // check if we have an annotation |
| 957 | - if ( ! $this->lexer->isNextTokenAny(self::$classIdentifiers)) { |
|
| 957 | + if (!$this->lexer->isNextTokenAny(self::$classIdentifiers)) { |
|
| 958 | 958 | $this->syntaxError('namespace separator or identifier'); |
| 959 | 959 | } |
| 960 | 960 | |
@@ -968,7 +968,7 @@ discard block |
||
| 968 | 968 | $this->match(DocLexer::T_NAMESPACE_SEPARATOR); |
| 969 | 969 | $this->matchAny(self::$classIdentifiers); |
| 970 | 970 | |
| 971 | - $className .= '\\' . $this->lexer->token['value']; |
|
| 971 | + $className .= '\\'.$this->lexer->token['value']; |
|
| 972 | 972 | } |
| 973 | 973 | |
| 974 | 974 | return $className; |
@@ -1016,11 +1016,11 @@ discard block |
||
| 1016 | 1016 | |
| 1017 | 1017 | case DocLexer::T_INTEGER: |
| 1018 | 1018 | $this->match(DocLexer::T_INTEGER); |
| 1019 | - return (int)$this->lexer->token['value']; |
|
| 1019 | + return (int) $this->lexer->token['value']; |
|
| 1020 | 1020 | |
| 1021 | 1021 | case DocLexer::T_FLOAT: |
| 1022 | 1022 | $this->match(DocLexer::T_FLOAT); |
| 1023 | - return (float)$this->lexer->token['value']; |
|
| 1023 | + return (float) $this->lexer->token['value']; |
|
| 1024 | 1024 | |
| 1025 | 1025 | case DocLexer::T_TRUE: |
| 1026 | 1026 | $this->match(DocLexer::T_TRUE); |
@@ -1148,9 +1148,9 @@ discard block |
||
| 1148 | 1148 | } |
| 1149 | 1149 | |
| 1150 | 1150 | foreach (array_keys($this->ignoredAnnotationNamespaces) as $ignoredAnnotationNamespace) { |
| 1151 | - $ignoredAnnotationNamespace = rtrim($ignoredAnnotationNamespace, '\\') . '\\'; |
|
| 1151 | + $ignoredAnnotationNamespace = rtrim($ignoredAnnotationNamespace, '\\').'\\'; |
|
| 1152 | 1152 | |
| 1153 | - if (0 === stripos(rtrim($name, '\\') . '\\', $ignoredAnnotationNamespace)) { |
|
| 1153 | + if (0 === stripos(rtrim($name, '\\').'\\', $ignoredAnnotationNamespace)) { |
|
| 1154 | 1154 | return true; |
| 1155 | 1155 | } |
| 1156 | 1156 | } |
@@ -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 | |
@@ -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 | |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | |
| 27 | 27 | public function __construct() |
| 28 | 28 | { |
| 29 | - $this->compiler = Llk::load(new Read(__DIR__ . '/type.pp')); |
|
| 29 | + $this->compiler = Llk::load(new Read(__DIR__.'/type.pp')); |
|
| 30 | 30 | $this->visitor = new TypeVisitor(); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | if ($typeNode instanceof UnionTypeNode) { |
| 87 | 87 | return new UnionType( |
| 88 | 88 | ...array_map( |
| 89 | - function (TypeNode $type) use ($scope) : Type { |
|
| 89 | + function(TypeNode $type) use ($scope) : Type { |
|
| 90 | 90 | return $this->resolveType($type, $scope); |
| 91 | 91 | }, |
| 92 | 92 | $typeNode->types |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | if ($typeNode instanceof IntersectionTypeNode) { |
| 98 | 98 | return new IntersectionType( |
| 99 | 99 | ...array_map( |
| 100 | - function (TypeNode $type) use ($scope) : Type { |
|
| 100 | + function(TypeNode $type) use ($scope) : Type { |
|
| 101 | 101 | return $this->resolveType($type, $scope); |
| 102 | 102 | }, |
| 103 | 103 | $typeNode->types |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | if ($element->getId() === Nodes::UNION) { |
| 111 | 111 | return new UnionType( |
| 112 | 112 | ...array_map( |
| 113 | - function (TreeNode $node) : Type { |
|
| 113 | + function(TreeNode $node) : Type { |
|
| 114 | 114 | return $this->visit($node); |
| 115 | 115 | }, |
| 116 | 116 | $element->getChildren() |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | if ($element->getId() === Nodes::INTERSECTION) { |
| 122 | 122 | return new IntersectionType( |
| 123 | 123 | ...array_map( |
| 124 | - function (TreeNode $node) : Type { |
|
| 124 | + function(TreeNode $node) : Type { |
|
| 125 | 125 | return $this->visit($node); |
| 126 | 126 | }, |
| 127 | 127 | $element->getChildren() |