@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | public function __construct(Reader $reader, $cacheDir, $debug = false, $umask = 0002) |
| 57 | 57 | { |
| 58 | - if ( ! is_int($umask)) { |
|
| 58 | + if (!is_int($umask)) { |
|
| 59 | 59 | throw new \InvalidArgumentException(sprintf( |
| 60 | 60 | 'The parameter umask must be an integer, was: %s', |
| 61 | 61 | gettype($umask) |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | public function getClassAnnotations(\ReflectionClass $class) |
| 80 | 80 | { |
| 81 | - if ( ! isset($this->classNameHashes[$class->name])) { |
|
| 81 | + if (!isset($this->classNameHashes[$class->name])) { |
|
| 82 | 82 | $this->classNameHashes[$class->name] = sha1($class->name); |
| 83 | 83 | } |
| 84 | 84 | $key = $this->classNameHashes[$class->name]; |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | public function getPropertyAnnotations(\ReflectionProperty $property) |
| 114 | 114 | { |
| 115 | 115 | $class = $property->getDeclaringClass(); |
| 116 | - if ( ! isset($this->classNameHashes[$class->name])) { |
|
| 116 | + if (!isset($this->classNameHashes[$class->name])) { |
|
| 117 | 117 | $this->classNameHashes[$class->name] = sha1($class->name); |
| 118 | 118 | } |
| 119 | 119 | $key = $this->classNameHashes[$class->name].'$'.$property->getName(); |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | public function getMethodAnnotations(\ReflectionMethod $method) |
| 149 | 149 | { |
| 150 | 150 | $class = $method->getDeclaringClass(); |
| 151 | - if ( ! isset($this->classNameHashes[$class->name])) { |
|
| 151 | + if (!isset($this->classNameHashes[$class->name])) { |
|
| 152 | 152 | $this->classNameHashes[$class->name] = sha1($class->name); |
| 153 | 153 | } |
| 154 | 154 | $key = $this->classNameHashes[$class->name].'#'.$method->getName(); |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | 'array_type'=>'string', |
| 153 | 153 | 'value' =>'array<string>' |
| 154 | 154 | ] |
| 155 | - ], |
|
| 155 | + ], |
|
| 156 | 156 | ], |
| 157 | 157 | 'Doctrine\Common\Annotations\Annotation\Attribute' => [ |
| 158 | 158 | 'is_annotation' => true, |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | 'type' =>'boolean', |
| 182 | 182 | 'value' =>'boolean' |
| 183 | 183 | ] |
| 184 | - ], |
|
| 184 | + ], |
|
| 185 | 185 | ], |
| 186 | 186 | 'Doctrine\Common\Annotations\Annotation\Attributes' => [ |
| 187 | 187 | 'is_annotation' => true, |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | 'array_type'=>'Doctrine\Common\Annotations\Annotation\Attribute', |
| 200 | 200 | 'value' =>'array<Doctrine\Common\Annotations\Annotation\Attribute>' |
| 201 | 201 | ] |
| 202 | - ], |
|
| 202 | + ], |
|
| 203 | 203 | ], |
| 204 | 204 | 'Doctrine\Common\Annotations\Annotation\Enum' => [ |
| 205 | 205 | 'is_annotation' => true, |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | 'type' => 'array', |
| 220 | 220 | 'required' => false, |
| 221 | 221 | ], |
| 222 | - ], |
|
| 222 | + ], |
|
| 223 | 223 | ], |
| 224 | 224 | ]; |
| 225 | 225 | |
@@ -761,7 +761,7 @@ discard block |
||
| 761 | 761 | if (0 === (self::$annotationMetadata[$name]['targets'] & $target) && $target) { |
| 762 | 762 | throw AnnotationException::semanticalError( |
| 763 | 763 | sprintf('Annotation @%s is not allowed to be declared on %s. You may only use this annotation on these code elements: %s.', |
| 764 | - $originalName, $this->context, self::$annotationMetadata[$name]['targets_literal']) |
|
| 764 | + $originalName, $this->context, self::$annotationMetadata[$name]['targets_literal']) |
|
| 765 | 765 | ); |
| 766 | 766 | } |
| 767 | 767 | |
@@ -930,9 +930,9 @@ discard block |
||
| 930 | 930 | case !empty ($this->namespaces): |
| 931 | 931 | foreach ($this->namespaces as $ns) { |
| 932 | 932 | if (class_exists($ns.'\\'.$className) || interface_exists($ns.'\\'.$className)) { |
| 933 | - $className = $ns.'\\'.$className; |
|
| 934 | - $found = true; |
|
| 935 | - break; |
|
| 933 | + $className = $ns.'\\'.$className; |
|
| 934 | + $found = true; |
|
| 935 | + break; |
|
| 936 | 936 | } |
| 937 | 937 | } |
| 938 | 938 | break; |
@@ -957,7 +957,7 @@ discard block |
||
| 957 | 957 | } |
| 958 | 958 | |
| 959 | 959 | if ($found) { |
| 960 | - $identifier = $className . '::' . $const; |
|
| 960 | + $identifier = $className . '::' . $const; |
|
| 961 | 961 | } |
| 962 | 962 | } |
| 963 | 963 | |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | */ |
| 391 | 391 | private function match($token) |
| 392 | 392 | { |
| 393 | - if ( ! $this->lexer->isNextToken($token) ) { |
|
| 393 | + if (!$this->lexer->isNextToken($token)) { |
|
| 394 | 394 | $this->syntaxError($this->lexer->getLiteral($token)); |
| 395 | 395 | } |
| 396 | 396 | |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | */ |
| 410 | 410 | private function matchAny(array $tokens) |
| 411 | 411 | { |
| 412 | - if ( ! $this->lexer->isNextTokenAny($tokens)) { |
|
| 412 | + if (!$this->lexer->isNextTokenAny($tokens)) { |
|
| 413 | 413 | $this->syntaxError(implode(' or ', array_map([$this->lexer, 'getLiteral'], $tokens))); |
| 414 | 414 | } |
| 415 | 415 | |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | : sprintf("'%s' at position %s", $token['value'], $token['position']); |
| 439 | 439 | |
| 440 | 440 | if (strlen($this->context)) { |
| 441 | - $message .= ' in ' . $this->context; |
|
| 441 | + $message .= ' in '.$this->context; |
|
| 442 | 442 | } |
| 443 | 443 | |
| 444 | 444 | $message .= '.'; |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | if ($metadata['is_annotation']) { |
| 517 | 517 | self::$metadataParser->setTarget(Target::TARGET_CLASS); |
| 518 | 518 | |
| 519 | - foreach (self::$metadataParser->parse($docComment, 'class @' . $name) as $annotation) { |
|
| 519 | + foreach (self::$metadataParser->parse($docComment, 'class @'.$name) as $annotation) { |
|
| 520 | 520 | if ($annotation instanceof Target) { |
| 521 | 521 | $metadata['targets'] = $annotation->targets; |
| 522 | 522 | $metadata['targets_literal'] = $annotation->literal; |
@@ -545,7 +545,7 @@ discard block |
||
| 545 | 545 | |
| 546 | 546 | $attribute->required = (false !== strpos($propertyComment, '@Required')); |
| 547 | 547 | $attribute->name = $property->name; |
| 548 | - $attribute->type = (false !== strpos($propertyComment, '@var') && preg_match('/@var\s+([^\s]+)/',$propertyComment, $matches)) |
|
| 548 | + $attribute->type = (false !== strpos($propertyComment, '@var') && preg_match('/@var\s+([^\s]+)/', $propertyComment, $matches)) |
|
| 549 | 549 | ? $matches[1] |
| 550 | 550 | : 'mixed'; |
| 551 | 551 | |
@@ -553,17 +553,17 @@ discard block |
||
| 553 | 553 | |
| 554 | 554 | // checks if the property has @Enum |
| 555 | 555 | if (false !== strpos($propertyComment, '@Enum')) { |
| 556 | - $context = 'property ' . $class->name . "::\$" . $property->name; |
|
| 556 | + $context = 'property '.$class->name."::\$".$property->name; |
|
| 557 | 557 | |
| 558 | 558 | self::$metadataParser->setTarget(Target::TARGET_PROPERTY); |
| 559 | 559 | |
| 560 | 560 | foreach (self::$metadataParser->parse($propertyComment, $context) as $annotation) { |
| 561 | - if ( ! $annotation instanceof Enum) { |
|
| 561 | + if (!$annotation instanceof Enum) { |
|
| 562 | 562 | continue; |
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | $metadata['enum'][$property->name]['value'] = $annotation->value; |
| 566 | - $metadata['enum'][$property->name]['literal'] = ( ! empty($annotation->literal)) |
|
| 566 | + $metadata['enum'][$property->name]['literal'] = (!empty($annotation->literal)) |
|
| 567 | 567 | ? $annotation->literal |
| 568 | 568 | : $annotation->value; |
| 569 | 569 | } |
@@ -698,7 +698,7 @@ discard block |
||
| 698 | 698 | |
| 699 | 699 | if ('\\' !== $name[0]) { |
| 700 | 700 | $pos = strpos($name, '\\'); |
| 701 | - $alias = (false === $pos)? $name : substr($name, 0, $pos); |
|
| 701 | + $alias = (false === $pos) ? $name : substr($name, 0, $pos); |
|
| 702 | 702 | $found = false; |
| 703 | 703 | $loweredAlias = strtolower($alias); |
| 704 | 704 | |
@@ -713,20 +713,20 @@ discard block |
||
| 713 | 713 | } elseif (isset($this->imports[$loweredAlias])) { |
| 714 | 714 | $namespace = ltrim($this->imports[$loweredAlias], '\\'); |
| 715 | 715 | $name = (false !== $pos) |
| 716 | - ? $namespace . substr($name, $pos) |
|
| 716 | + ? $namespace.substr($name, $pos) |
|
| 717 | 717 | : $namespace; |
| 718 | 718 | $found = $this->classExists($name); |
| 719 | - } elseif ( ! isset($this->ignoredAnnotationNames[$name]) |
|
| 719 | + } elseif (!isset($this->ignoredAnnotationNames[$name]) |
|
| 720 | 720 | && isset($this->imports['__NAMESPACE__']) |
| 721 | - && $this->classExists($this->imports['__NAMESPACE__'] . '\\' . $name) |
|
| 721 | + && $this->classExists($this->imports['__NAMESPACE__'].'\\'.$name) |
|
| 722 | 722 | ) { |
| 723 | 723 | $name = $this->imports['__NAMESPACE__'].'\\'.$name; |
| 724 | 724 | $found = true; |
| 725 | - } elseif (! isset($this->ignoredAnnotationNames[$name]) && $this->classExists($name)) { |
|
| 725 | + } elseif (!isset($this->ignoredAnnotationNames[$name]) && $this->classExists($name)) { |
|
| 726 | 726 | $found = true; |
| 727 | 727 | } |
| 728 | 728 | |
| 729 | - if ( ! $found) { |
|
| 729 | + if (!$found) { |
|
| 730 | 730 | if ($this->isIgnoredAnnotation($name)) { |
| 731 | 731 | return false; |
| 732 | 732 | } |
@@ -735,9 +735,9 @@ discard block |
||
| 735 | 735 | } |
| 736 | 736 | } |
| 737 | 737 | |
| 738 | - $name = ltrim($name,'\\'); |
|
| 738 | + $name = ltrim($name, '\\'); |
|
| 739 | 739 | |
| 740 | - if ( ! $this->classExists($name)) { |
|
| 740 | + if (!$this->classExists($name)) { |
|
| 741 | 741 | throw AnnotationException::semanticalError(sprintf('The annotation "@%s" in %s does not exist, or could not be auto-loaded.', $name, $this->context)); |
| 742 | 742 | } |
| 743 | 743 | |
@@ -747,7 +747,7 @@ discard block |
||
| 747 | 747 | |
| 748 | 748 | |
| 749 | 749 | // collects the metadata annotation only if there is not yet |
| 750 | - if ( ! isset(self::$annotationMetadata[$name])) { |
|
| 750 | + if (!isset(self::$annotationMetadata[$name])) { |
|
| 751 | 751 | $this->collectAnnotationMetadata($name); |
| 752 | 752 | } |
| 753 | 753 | |
@@ -780,7 +780,7 @@ discard block |
||
| 780 | 780 | // checks all declared attributes |
| 781 | 781 | foreach (self::$annotationMetadata[$name]['enum'] as $property => $enum) { |
| 782 | 782 | // checks if the attribute is a valid enumerator |
| 783 | - if (isset($values[$property]) && ! in_array($values[$property], $enum['value'])) { |
|
| 783 | + if (isset($values[$property]) && !in_array($values[$property], $enum['value'])) { |
|
| 784 | 784 | throw AnnotationException::enumeratorError($property, $name, $this->context, $enum['literal'], $values[$property]); |
| 785 | 785 | } |
| 786 | 786 | } |
@@ -804,7 +804,7 @@ discard block |
||
| 804 | 804 | |
| 805 | 805 | if ($type['type'] === 'array') { |
| 806 | 806 | // handle the case of a single value |
| 807 | - if ( ! is_array($values[$property])) { |
|
| 807 | + if (!is_array($values[$property])) { |
|
| 808 | 808 | $values[$property] = [$values[$property]]; |
| 809 | 809 | } |
| 810 | 810 | |
@@ -836,7 +836,7 @@ discard block |
||
| 836 | 836 | } |
| 837 | 837 | |
| 838 | 838 | // handle the case if the property has no annotations |
| 839 | - if ( ! $property = self::$annotationMetadata[$name]['default_property']) { |
|
| 839 | + if (!$property = self::$annotationMetadata[$name]['default_property']) { |
|
| 840 | 840 | throw AnnotationException::creationError(sprintf('The annotation @%s declared on %s does not accept any values, but got %s.', $originalName, $this->context, json_encode($values))); |
| 841 | 841 | } |
| 842 | 842 | } |
@@ -856,13 +856,13 @@ discard block |
||
| 856 | 856 | { |
| 857 | 857 | $values = []; |
| 858 | 858 | |
| 859 | - if ( ! $this->lexer->isNextToken(DocLexer::T_OPEN_PARENTHESIS)) { |
|
| 859 | + if (!$this->lexer->isNextToken(DocLexer::T_OPEN_PARENTHESIS)) { |
|
| 860 | 860 | return $values; |
| 861 | 861 | } |
| 862 | 862 | |
| 863 | 863 | $this->match(DocLexer::T_OPEN_PARENTHESIS); |
| 864 | 864 | |
| 865 | - if ( ! $this->lexer->isNextToken(DocLexer::T_CLOSE_PARENTHESIS)) { |
|
| 865 | + if (!$this->lexer->isNextToken(DocLexer::T_CLOSE_PARENTHESIS)) { |
|
| 866 | 866 | $values = $this->Values(); |
| 867 | 867 | } |
| 868 | 868 | |
@@ -890,7 +890,7 @@ discard block |
||
| 890 | 890 | $token = $this->lexer->lookahead; |
| 891 | 891 | $value = $this->Value(); |
| 892 | 892 | |
| 893 | - if ( ! is_object($value) && ! is_array($value)) { |
|
| 893 | + if (!is_object($value) && !is_array($value)) { |
|
| 894 | 894 | $this->syntaxError('Value', $token); |
| 895 | 895 | } |
| 896 | 896 | |
@@ -900,10 +900,10 @@ discard block |
||
| 900 | 900 | foreach ($values as $k => $value) { |
| 901 | 901 | if (is_object($value) && $value instanceof \stdClass) { |
| 902 | 902 | $values[$value->name] = $value->value; |
| 903 | - } else if ( ! isset($values['value'])){ |
|
| 903 | + } else if (!isset($values['value'])) { |
|
| 904 | 904 | $values['value'] = $value; |
| 905 | 905 | } else { |
| 906 | - if ( ! is_array($values['value'])) { |
|
| 906 | + if (!is_array($values['value'])) { |
|
| 907 | 907 | $values['value'] = [$values['value']]; |
| 908 | 908 | } |
| 909 | 909 | |
@@ -927,7 +927,7 @@ discard block |
||
| 927 | 927 | { |
| 928 | 928 | $identifier = $this->Identifier(); |
| 929 | 929 | |
| 930 | - if ( ! defined($identifier) && false !== strpos($identifier, '::') && '\\' !== $identifier[0]) { |
|
| 930 | + if (!defined($identifier) && false !== strpos($identifier, '::') && '\\' !== $identifier[0]) { |
|
| 931 | 931 | list($className, $const) = explode('::', $identifier); |
| 932 | 932 | |
| 933 | 933 | $pos = strpos($className, '\\'); |
@@ -949,12 +949,12 @@ discard block |
||
| 949 | 949 | case isset($this->imports[$loweredAlias]): |
| 950 | 950 | $found = true; |
| 951 | 951 | $className = (false !== $pos) |
| 952 | - ? $this->imports[$loweredAlias] . substr($className, $pos) |
|
| 952 | + ? $this->imports[$loweredAlias].substr($className, $pos) |
|
| 953 | 953 | : $this->imports[$loweredAlias]; |
| 954 | 954 | break; |
| 955 | 955 | |
| 956 | 956 | default: |
| 957 | - if(isset($this->imports['__NAMESPACE__'])) { |
|
| 957 | + if (isset($this->imports['__NAMESPACE__'])) { |
|
| 958 | 958 | $ns = $this->imports['__NAMESPACE__']; |
| 959 | 959 | |
| 960 | 960 | if (class_exists($ns.'\\'.$className) || interface_exists($ns.'\\'.$className)) { |
@@ -966,14 +966,14 @@ discard block |
||
| 966 | 966 | } |
| 967 | 967 | |
| 968 | 968 | if ($found) { |
| 969 | - $identifier = $className . '::' . $const; |
|
| 969 | + $identifier = $className.'::'.$const; |
|
| 970 | 970 | } |
| 971 | 971 | } |
| 972 | 972 | |
| 973 | 973 | /** |
| 974 | 974 | * Checks if identifier ends with ::class and remove the leading backslash if it exists. |
| 975 | 975 | */ |
| 976 | - if ($this->identifierEndsWithClassConstant($identifier) && ! $this->identifierStartsWithBackslash($identifier)) { |
|
| 976 | + if ($this->identifierEndsWithClassConstant($identifier) && !$this->identifierStartsWithBackslash($identifier)) { |
|
| 977 | 977 | return substr($identifier, 0, $this->getClassConstantPositionInIdentifier($identifier)); |
| 978 | 978 | } |
| 979 | 979 | if ($this->identifierEndsWithClassConstant($identifier) && $this->identifierStartsWithBackslash($identifier)) { |
@@ -1013,7 +1013,7 @@ discard block |
||
| 1013 | 1013 | private function Identifier() |
| 1014 | 1014 | { |
| 1015 | 1015 | // check if we have an annotation |
| 1016 | - if ( ! $this->lexer->isNextTokenAny(self::$classIdentifiers)) { |
|
| 1016 | + if (!$this->lexer->isNextTokenAny(self::$classIdentifiers)) { |
|
| 1017 | 1017 | $this->syntaxError('namespace separator or identifier'); |
| 1018 | 1018 | } |
| 1019 | 1019 | |
@@ -1029,7 +1029,7 @@ discard block |
||
| 1029 | 1029 | $this->match(DocLexer::T_NAMESPACE_SEPARATOR); |
| 1030 | 1030 | $this->matchAny(self::$classIdentifiers); |
| 1031 | 1031 | |
| 1032 | - $className .= '\\' . $this->lexer->token['value']; |
|
| 1032 | + $className .= '\\'.$this->lexer->token['value']; |
|
| 1033 | 1033 | } |
| 1034 | 1034 | |
| 1035 | 1035 | return $className; |
@@ -1077,11 +1077,11 @@ discard block |
||
| 1077 | 1077 | |
| 1078 | 1078 | case DocLexer::T_INTEGER: |
| 1079 | 1079 | $this->match(DocLexer::T_INTEGER); |
| 1080 | - return (int)$this->lexer->token['value']; |
|
| 1080 | + return (int) $this->lexer->token['value']; |
|
| 1081 | 1081 | |
| 1082 | 1082 | case DocLexer::T_FLOAT: |
| 1083 | 1083 | $this->match(DocLexer::T_FLOAT); |
| 1084 | - return (float)$this->lexer->token['value']; |
|
| 1084 | + return (float) $this->lexer->token['value']; |
|
| 1085 | 1085 | |
| 1086 | 1086 | case DocLexer::T_TRUE: |
| 1087 | 1087 | $this->match(DocLexer::T_TRUE); |
@@ -1209,9 +1209,9 @@ discard block |
||
| 1209 | 1209 | } |
| 1210 | 1210 | |
| 1211 | 1211 | foreach (array_keys($this->ignoredAnnotationNamespaces) as $ignoredAnnotationNamespace) { |
| 1212 | - $ignoredAnnotationNamespace = rtrim($ignoredAnnotationNamespace, '\\') . '\\'; |
|
| 1212 | + $ignoredAnnotationNamespace = rtrim($ignoredAnnotationNamespace, '\\').'\\'; |
|
| 1213 | 1213 | |
| 1214 | - if (0 === stripos(rtrim($name, '\\') . '\\', $ignoredAnnotationNamespace)) { |
|
| 1214 | + if (0 === stripos(rtrim($name, '\\').'\\', $ignoredAnnotationNamespace)) { |
|
| 1215 | 1215 | return true; |
| 1216 | 1216 | } |
| 1217 | 1217 | } |
@@ -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 | |
@@ -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 | |
@@ -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; |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | public static function registerUniqueLoader(callable $callable) : void |
| 125 | 125 | { |
| 126 | - if ( ! in_array($callable, self::$loaders, true) ) { |
|
| 126 | + if (!in_array($callable, self::$loaders, true)) { |
|
| 127 | 127 | self::registerLoader($callable); |
| 128 | 128 | } |
| 129 | 129 | } |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | foreach (self::$autoloadNamespaces AS $namespace => $dirs) { |
| 145 | 145 | if (\strpos($class, $namespace) === 0) { |
| 146 | - $file = \str_replace('\\', \DIRECTORY_SEPARATOR, $class) . '.php'; |
|
| 146 | + $file = \str_replace('\\', \DIRECTORY_SEPARATOR, $class).'.php'; |
|
| 147 | 147 | |
| 148 | 148 | if ($dirs === null) { |
| 149 | 149 | if ($path = stream_resolve_include_path($file)) { |
@@ -151,9 +151,9 @@ discard block |
||
| 151 | 151 | return true; |
| 152 | 152 | } |
| 153 | 153 | } else { |
| 154 | - foreach((array) $dirs AS $dir) { |
|
| 155 | - if (is_file($dir . \DIRECTORY_SEPARATOR . $file)) { |
|
| 156 | - require $dir . \DIRECTORY_SEPARATOR . $file; |
|
| 154 | + foreach ((array) $dirs AS $dir) { |
|
| 155 | + if (is_file($dir.\DIRECTORY_SEPARATOR.$file)) { |
|
| 156 | + require $dir.\DIRECTORY_SEPARATOR.$file; |
|
| 157 | 157 | return true; |
| 158 | 158 | } |
| 159 | 159 | } |
@@ -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 | } |
@@ -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]; |
@@ -241,9 +241,9 @@ |
||
| 241 | 241 | return $this->loadedFilemtimes[$filename]; |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - $parent = $class->getParentClass(); |
|
| 244 | + $parent = $class->getParentClass(); |
|
| 245 | 245 | |
| 246 | - $lastModification = max(array_merge( |
|
| 246 | + $lastModification = max(array_merge( |
|
| 247 | 247 | [$filename ? filemtime($filename) : 0], |
| 248 | 248 | array_map([$this, 'getTraitLastModificationTime'], $class->getTraits()), |
| 249 | 249 | array_map([$this, 'getLastModification'], $class->getInterfaces()), |