@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $reflectionClass = $this->getReflectionClass($className); |
101 | 101 | |
102 | 102 | if ($this->isInstantiableViaReflection($reflectionClass)) { |
103 | - return function () use ($reflectionClass) { |
|
103 | + return function() use ($reflectionClass) { |
|
104 | 104 | return $reflectionClass->newInstanceWithoutConstructor(); |
105 | 105 | }; |
106 | 106 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | $this->checkIfUnSerializationIsSupported($reflectionClass, $serializedString); |
116 | 116 | |
117 | - return function () use ($serializedString) { |
|
117 | + return function() use ($serializedString) { |
|
118 | 118 | return unserialize($serializedString); |
119 | 119 | }; |
120 | 120 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | */ |
129 | 129 | private function getReflectionClass($className) |
130 | 130 | { |
131 | - if (! class_exists($className)) { |
|
131 | + if (!class_exists($className)) { |
|
132 | 132 | throw InvalidArgumentException::fromNonExistingClass($className); |
133 | 133 | } |
134 | 134 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | private function checkIfUnSerializationIsSupported(ReflectionClass $reflectionClass, $serializedString) |
153 | 153 | { |
154 | - set_error_handler(function ($code, $message, $file, $line) use ($reflectionClass, & $error) { |
|
154 | + set_error_handler(function($code, $message, $file, $line) use ($reflectionClass, & $error) { |
|
155 | 155 | $error = UnexpectedValueException::fromUncleanUnSerialization( |
156 | 156 | $reflectionClass, |
157 | 157 | $message, |
@@ -197,10 +197,10 @@ discard block |
||
197 | 197 | private function isInstantiableViaReflection(ReflectionClass $reflectionClass) |
198 | 198 | { |
199 | 199 | if (\PHP_VERSION_ID >= 50600) { |
200 | - return ! ($this->hasInternalAncestors($reflectionClass) && $reflectionClass->isFinal()); |
|
200 | + return !($this->hasInternalAncestors($reflectionClass) && $reflectionClass->isFinal()); |
|
201 | 201 | } |
202 | 202 | |
203 | - return \PHP_VERSION_ID >= 50400 && ! $this->hasInternalAncestors($reflectionClass); |
|
203 | + return \PHP_VERSION_ID >= 50400 && !$this->hasInternalAncestors($reflectionClass); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | /** |
@@ -263,11 +263,11 @@ discard block |
||
263 | 263 | */ |
264 | 264 | private function isSafeToClone(ReflectionClass $reflection) |
265 | 265 | { |
266 | - if (method_exists($reflection, 'isCloneable') && ! $reflection->isCloneable()) { |
|
266 | + if (method_exists($reflection, 'isCloneable') && !$reflection->isCloneable()) { |
|
267 | 267 | return false; |
268 | 268 | } |
269 | 269 | |
270 | 270 | // not cloneable if it implements `__clone`, as we want to avoid calling it |
271 | - return ! $reflection->hasMethod('__clone'); |
|
271 | + return !$reflection->hasMethod('__clone'); |
|
272 | 272 | } |
273 | 273 | } |
@@ -43,7 +43,7 @@ |
||
43 | 43 | $this->assertSame($previous, $exception->getPrevious()); |
44 | 44 | $this->assertSame( |
45 | 45 | 'An exception was raised while trying to instantiate an instance of "' |
46 | - . __CLASS__ . '" via un-serialization', |
|
46 | + . __CLASS__ . '" via un-serialization', |
|
47 | 47 | $exception->getMessage() |
48 | 48 | ); |
49 | 49 | } |
@@ -113,7 +113,7 @@ |
||
113 | 113 | $this->assertInstanceOf('Exception', $previous); |
114 | 114 | |
115 | 115 | // in PHP 5.4.29 and PHP 5.5.13, this case is not a notice, but an exception being thrown |
116 | - if (! (\PHP_VERSION_ID === 50429 || \PHP_VERSION_ID === 50513)) { |
|
116 | + if (!(\PHP_VERSION_ID === 50429 || \PHP_VERSION_ID === 50513)) { |
|
117 | 117 | $this->assertSame( |
118 | 118 | 'Could not produce an instance of "DoctrineTest\\InstantiatorTestAsset\WakeUpNoticesAsset" ' |
119 | 119 | . 'via un-serialization, since an error was triggered in file "' |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | && 'default' !== $namespace |
95 | 95 | ) { |
96 | 96 | // Srip leading and trailing slash |
97 | - $this->namespace = trim((string)$namespace, '\\'); |
|
97 | + $this->namespace = trim((string) $namespace, '\\'); |
|
98 | 98 | } else { |
99 | 99 | $this->namespace = ''; |
100 | 100 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function setNamespaceAlias($alias, $fqnn) |
133 | 133 | { |
134 | - $this->namespace_aliases[$alias] = '\\' . trim((string)$fqnn, '\\'); |
|
134 | + $this->namespace_aliases[$alias] = '\\' . trim((string) $fqnn, '\\'); |
|
135 | 135 | return $this; |
136 | 136 | } |
137 | 137 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public function setLSEN($lsen) |
150 | 150 | { |
151 | - $this->lsen = (string)$lsen; |
|
151 | + $this->lsen = (string) $lsen; |
|
152 | 152 | return $this; |
153 | 153 | } |
154 | 154 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | ); |
115 | 115 | |
116 | 116 | $count = count($this->parsedContents); |
117 | - for ($i=1; $i<$count; $i += 2) { |
|
117 | + for ($i = 1; $i < $count; $i += 2) { |
|
118 | 118 | $this->parsedContents[$i] = Tag::createInstance( |
119 | 119 | $this->parsedContents[$i], |
120 | 120 | $this->docblock |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | //In order to allow "literal" inline tags, the otherwise invalid |
125 | 125 | //sequence "{@}" is changed to "@", and "{}" is changed to "}". |
126 | 126 | //See unit tests for examples. |
127 | - for ($i=0; $i<$count; $i += 2) { |
|
127 | + for ($i = 0; $i < $count; $i += 2) { |
|
128 | 128 | $this->parsedContents[$i] = str_replace( |
129 | 129 | array('{@}', '{}'), |
130 | 130 | array('@', '}'), |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function setLineNumber($lineNumber) |
51 | 51 | { |
52 | - $this->lineNumber = (int)$lineNumber; |
|
52 | + $this->lineNumber = (int) $lineNumber; |
|
53 | 53 | |
54 | 54 | return $this; |
55 | 55 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function setColumnNumber($columnNumber) |
71 | 71 | { |
72 | - $this->columnNumber = (int)$columnNumber; |
|
72 | + $this->columnNumber = (int) $columnNumber; |
|
73 | 73 | |
74 | 74 | return $this; |
75 | 75 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function setIndentationString($indentString) |
69 | 69 | { |
70 | - $this->indentString = (string)$indentString; |
|
70 | + $this->indentString = (string) $indentString; |
|
71 | 71 | return $this; |
72 | 72 | } |
73 | 73 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function setIndent($indent) |
92 | 92 | { |
93 | - $this->indent = (int)$indent; |
|
93 | + $this->indent = (int) $indent; |
|
94 | 94 | return $this; |
95 | 95 | } |
96 | 96 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function setIsFirstLineIndented($indentFirstLine) |
118 | 118 | { |
119 | - $this->isFirstLineIndented = (bool)$indentFirstLine; |
|
119 | + $this->isFirstLineIndented = (bool) $indentFirstLine; |
|
120 | 120 | return $this; |
121 | 121 | } |
122 | 122 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | public function setLineLength($lineLength) |
145 | 145 | { |
146 | - $this->lineLength = null === $lineLength ? null : (int)$lineLength; |
|
146 | + $this->lineLength = null === $lineLength ? null : (int) $lineLength; |
|
147 | 147 | return $this; |
148 | 148 | } |
149 | 149 |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | if (isset(self::$tagHandlerMappings[$matches[1]])) { |
129 | 129 | $handler = self::$tagHandlerMappings[$matches[1]]; |
130 | 130 | } elseif (isset($docblock)) { |
131 | - $tagName = (string)new Type\Collection( |
|
131 | + $tagName = (string) new Type\Collection( |
|
132 | 132 | array($matches[1]), |
133 | 133 | $docblock->getContext() |
134 | 134 | ); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | */ |
163 | 163 | final public static function registerTagHandler($tag, $handler) |
164 | 164 | { |
165 | - $tag = trim((string)$tag); |
|
165 | + $tag = trim((string) $tag); |
|
166 | 166 | |
167 | 167 | if (null === $handler) { |
168 | 168 | unset(self::$tagHandlerMappings[$tag]); |
@@ -70,9 +70,9 @@ |
||
70 | 70 | $this->description, |
71 | 71 | $matches |
72 | 72 | )) { |
73 | - $this->startingLine = (int)$matches[1]; |
|
73 | + $this->startingLine = (int) $matches[1]; |
|
74 | 74 | if (isset($matches[2]) && '' !== $matches[2]) { |
75 | - $this->lineCount = (int)$matches[2]; |
|
75 | + $this->lineCount = (int) $matches[2]; |
|
76 | 76 | } |
77 | 77 | $this->setDescription($matches[3]); |
78 | 78 | $this->content = $content; |