@@ -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 | } |
@@ -34,11 +34,11 @@ |
||
34 | 34 | { |
35 | 35 | public function testFromNonExistingTypeWithNonExistingClass() |
36 | 36 | { |
37 | - $className = __CLASS__ . uniqid(); |
|
37 | + $className = __CLASS__.uniqid(); |
|
38 | 38 | $exception = InvalidArgumentException::fromNonExistingClass($className); |
39 | 39 | |
40 | 40 | $this->assertInstanceOf('Doctrine\\Instantiator\\Exception\\InvalidArgumentException', $exception); |
41 | - $this->assertSame('The provided class "' . $className . '" does not exist', $exception->getMessage()); |
|
41 | + $this->assertSame('The provided class "'.$className.'" does not exist', $exception->getMessage()); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | public function testFromNonExistingTypeWithTrait() |
@@ -113,11 +113,11 @@ discard block |
||
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 "' |
120 | - . $wakeUpNoticesReflection->getFileName() . '" at line "36"', |
|
120 | + . $wakeUpNoticesReflection->getFileName().'" at line "36"', |
|
121 | 121 | $exception->getMessage() |
122 | 122 | ); |
123 | 123 | |
@@ -141,15 +141,15 @@ discard block |
||
141 | 141 | |
142 | 142 | public function testInstancesAreNotCloned() |
143 | 143 | { |
144 | - $className = 'TemporaryClass' . uniqid(); |
|
144 | + $className = 'TemporaryClass'.uniqid(); |
|
145 | 145 | |
146 | - eval('namespace ' . __NAMESPACE__ . '; class ' . $className . '{}'); |
|
146 | + eval('namespace '.__NAMESPACE__.'; class '.$className.'{}'); |
|
147 | 147 | |
148 | - $instance = $this->instantiator->instantiate(__NAMESPACE__ . '\\' . $className); |
|
148 | + $instance = $this->instantiator->instantiate(__NAMESPACE__.'\\'.$className); |
|
149 | 149 | |
150 | 150 | $instance->foo = 'bar'; |
151 | 151 | |
152 | - $instance2 = $this->instantiator->instantiate(__NAMESPACE__ . '\\' . $className); |
|
152 | + $instance2 = $this->instantiator->instantiate(__NAMESPACE__.'\\'.$className); |
|
153 | 153 | |
154 | 154 | $this->assertObjectNotHasAttribute('foo', $instance2); |
155 | 155 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | public function getInvalidClassNames() |
206 | 206 | { |
207 | 207 | $classNames = array( |
208 | - array(__CLASS__ . uniqid()), |
|
208 | + array(__CLASS__.uniqid()), |
|
209 | 209 | array('Doctrine\\Instantiator\\InstantiatorInterface'), |
210 | 210 | array('DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset'), |
211 | 211 | ); |
@@ -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 | } |