@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | 'Required' => true, |
60 | 60 | 'Target' => true, |
61 | 61 | // Widely used tags (but not existent in phpdoc) |
62 | - 'fix' => true , 'fixme' => true, |
|
62 | + 'fix' => true, 'fixme' => true, |
|
63 | 63 | 'override' => true, |
64 | 64 | // PHPDocumentor 1 tags |
65 | 65 | 'abstract'=> true, 'access'=> true, |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | throw AnnotationException::optimizerPlusSaveComments(); |
188 | 188 | } |
189 | 189 | |
190 | - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/IgnoreAnnotation.php'); |
|
190 | + AnnotationRegistry::registerFile(__DIR__.'/Annotation/IgnoreAnnotation.php'); |
|
191 | 191 | |
192 | 192 | $this->parser = $parser ?: new DocParser(); |
193 | 193 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class)); |
210 | 210 | $this->parser->setIgnoredAnnotationNamespaces(self::$globalIgnoredNamespaces); |
211 | 211 | |
212 | - return $this->parser->parse($class->getDocComment(), 'class ' . $class->getName()); |
|
212 | + return $this->parser->parse($class->getDocComment(), 'class '.$class->getName()); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | /** |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | public function getPropertyAnnotations(ReflectionProperty $property) |
235 | 235 | { |
236 | 236 | $class = $property->getDeclaringClass(); |
237 | - $context = 'property ' . $class->getName() . "::\$" . $property->getName(); |
|
237 | + $context = 'property '.$class->getName()."::\$".$property->getName(); |
|
238 | 238 | |
239 | 239 | $this->parser->setTarget(Target::TARGET_PROPERTY); |
240 | 240 | $this->parser->setImports($this->getPropertyImports($property)); |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | public function getMethodAnnotations(ReflectionMethod $method) |
267 | 267 | { |
268 | 268 | $class = $method->getDeclaringClass(); |
269 | - $context = 'method ' . $class->getName() . '::' . $method->getName() . '()'; |
|
269 | + $context = 'method '.$class->getName().'::'.$method->getName().'()'; |
|
270 | 270 | |
271 | 271 | $this->parser->setTarget(Target::TARGET_METHOD); |
272 | 272 | $this->parser->setImports($this->getMethodImports($method)); |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | private function collectParsingMetadata(ReflectionClass $class) |
387 | 387 | { |
388 | 388 | $ignoredAnnotationNames = self::$globalIgnoredNames; |
389 | - $annotations = $this->preParser->parse($class->getDocComment(), 'class ' . $class->name); |
|
389 | + $annotations = $this->preParser->parse($class->getDocComment(), 'class '.$class->name); |
|
390 | 390 | |
391 | 391 | foreach ($annotations as $annotation) { |
392 | 392 | 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 |
@@ -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 | } |
@@ -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; |
@@ -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 |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function __construct(Reader $reader, $cacheDir, $debug = false, $umask = 0002) |
74 | 74 | { |
75 | - if ( ! is_int($umask)) { |
|
75 | + if (!is_int($umask)) { |
|
76 | 76 | throw new \InvalidArgumentException(sprintf( |
77 | 77 | 'The parameter umask must be an integer, was: %s', |
78 | 78 | gettype($umask) |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function getClassAnnotations(\ReflectionClass $class) |
97 | 97 | { |
98 | - if ( ! isset($this->classNameHashes[$class->name])) { |
|
98 | + if (!isset($this->classNameHashes[$class->name])) { |
|
99 | 99 | $this->classNameHashes[$class->name] = sha1($class->name); |
100 | 100 | } |
101 | 101 | $key = $this->classNameHashes[$class->name]; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | public function getPropertyAnnotations(\ReflectionProperty $property) |
131 | 131 | { |
132 | 132 | $class = $property->getDeclaringClass(); |
133 | - if ( ! isset($this->classNameHashes[$class->name])) { |
|
133 | + if (!isset($this->classNameHashes[$class->name])) { |
|
134 | 134 | $this->classNameHashes[$class->name] = sha1($class->name); |
135 | 135 | } |
136 | 136 | $key = $this->classNameHashes[$class->name].'$'.$property->getName(); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | public function getMethodAnnotations(\ReflectionMethod $method) |
166 | 166 | { |
167 | 167 | $class = $method->getDeclaringClass(); |
168 | - if ( ! isset($this->classNameHashes[$class->name])) { |
|
168 | + if (!isset($this->classNameHashes[$class->name])) { |
|
169 | 169 | $this->classNameHashes[$class->name] = sha1($class->name); |
170 | 170 | } |
171 | 171 | $key = $this->classNameHashes[$class->name].'#'.$method->getName(); |
@@ -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 | } |
@@ -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]; |
@@ -30,7 +30,7 @@ |
||
30 | 30 | public function add(AnnotationMetadata ...$metadatas) : void |
31 | 31 | { |
32 | 32 | foreach ($metadatas as $metadata) { |
33 | - assert(! isset($this[$metadata->getName()]), sprintf('Metadata with name %s already exists.', $metadata->getName())); |
|
33 | + assert(!isset($this[$metadata->getName()]), sprintf('Metadata with name %s already exists.', $metadata->getName())); |
|
34 | 34 | |
35 | 35 | $this->metadata[$metadata->getName()] = $metadata; |
36 | 36 | } |