@@ -40,41 +40,41 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | public function itShouldAllowDefiningNewServiceAfterFreezingFirst() |
| 42 | 42 | { |
| 43 | - $this['foo'] = function () { |
|
| 43 | + $this['foo'] = function() { |
|
| 44 | 44 | return 'fooValue'; |
| 45 | 45 | }; |
| 46 | 46 | $this['foo']; |
| 47 | - $this['bar'] = function () { |
|
| 47 | + $this['bar'] = function() { |
|
| 48 | 48 | return 'barValue'; |
| 49 | 49 | }; |
| 50 | 50 | $this['bar']->shouldReturn('barValue'); |
| 51 | 51 | } |
| 52 | 52 | public function itShouldAllowExtendingNonFrozenService() |
| 53 | 53 | { |
| 54 | - $this['foo'] = function () { |
|
| 54 | + $this['foo'] = function() { |
|
| 55 | 55 | return 'foo'; |
| 56 | 56 | }; |
| 57 | 57 | $this['foo'] = $this->extend('foo', |
| 58 | - function ($foo) { |
|
| 58 | + function($foo) { |
|
| 59 | 59 | return "$foo.bar"; |
| 60 | 60 | }); |
| 61 | 61 | $this['foo'] = $this->extend('foo', |
| 62 | - function ($foo) { |
|
| 62 | + function($foo) { |
|
| 63 | 63 | return "$foo.baz"; |
| 64 | 64 | }); |
| 65 | 65 | $this['foo']->shouldReturn('foo.bar.baz'); |
| 66 | 66 | } |
| 67 | 67 | public function itShouldAllowExtendingOtherServiceAfterFreezingFirst() |
| 68 | 68 | { |
| 69 | - $this['foo'] = function () { |
|
| 69 | + $this['foo'] = function() { |
|
| 70 | 70 | return 'foo'; |
| 71 | 71 | }; |
| 72 | - $this['bar'] = function () { |
|
| 72 | + $this['bar'] = function() { |
|
| 73 | 73 | return 'bar'; |
| 74 | 74 | }; |
| 75 | 75 | $this['foo']; |
| 76 | 76 | $this['bar'] = $this->extend('bar', |
| 77 | - function ($bar, $app) { |
|
| 77 | + function($bar, $app) { |
|
| 78 | 78 | return "$bar.baz"; |
| 79 | 79 | }); |
| 80 | 80 | $this['bar']->shouldReturn('bar.baz'); |
@@ -89,19 +89,19 @@ discard block |
||
| 89 | 89 | } |
| 90 | 90 | public function itShouldAllowRemovingFrozenServiceAndThenSettingAgain() |
| 91 | 91 | { |
| 92 | - $this['foo'] = function () { |
|
| 92 | + $this['foo'] = function() { |
|
| 93 | 93 | return 'fooValue'; |
| 94 | 94 | }; |
| 95 | 95 | $this['foo']; |
| 96 | 96 | unset($this['foo']); |
| 97 | - $this['foo'] = function () { |
|
| 97 | + $this['foo'] = function() { |
|
| 98 | 98 | return 'barValue'; |
| 99 | 99 | }; |
| 100 | 100 | } |
| 101 | 101 | public function itShouldAlsoUnsetKeyWhenUnsettingOffsets() |
| 102 | 102 | { |
| 103 | 103 | $this['param'] = 'value'; |
| 104 | - $this['service'] = function () { |
|
| 104 | + $this['service'] = function() { |
|
| 105 | 105 | return new MockService(); |
| 106 | 106 | }; |
| 107 | 107 | $this->keys() |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | public function itShouldNotInvokeProtectedServices() |
| 145 | 145 | { |
| 146 | 146 | $services = [ |
| 147 | - function ($value) { |
|
| 147 | + function($value) { |
|
| 148 | 148 | $service = new MockService(); |
| 149 | 149 | $service->value = $value; |
| 150 | 150 | return $service; |
@@ -158,10 +158,10 @@ discard block |
||
| 158 | 158 | } |
| 159 | 159 | public function itShouldPassContainerAsParameter() |
| 160 | 160 | { |
| 161 | - $this['service'] = function () { |
|
| 161 | + $this['service'] = function() { |
|
| 162 | 162 | return new MockService(); |
| 163 | 163 | }; |
| 164 | - $this['container'] = function ($container) { |
|
| 164 | + $this['container'] = function($container) { |
|
| 165 | 165 | return $container; |
| 166 | 166 | }; |
| 167 | 167 | $this['service']->shouldNotEqual($this); |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | } |
| 170 | 170 | public function itShouldReturnDifferentInstancesOfSameTypeFromFactory() |
| 171 | 171 | { |
| 172 | - $this['service'] = $this->factory(function () { |
|
| 172 | + $this['service'] = $this->factory(function() { |
|
| 173 | 173 | return new MockService(); |
| 174 | 174 | }); |
| 175 | 175 | $serviceOne = $this['service']->shouldHaveType('Spec\Yapeal\MockService'); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | } |
| 178 | 178 | public function itShouldReturnOriginalInstanceFromRawWhenUsingFactory() |
| 179 | 179 | { |
| 180 | - $definition = $this->factory(function () { |
|
| 180 | + $definition = $this->factory(function() { |
|
| 181 | 181 | return 'foo'; |
| 182 | 182 | }); |
| 183 | 183 | $this['service'] = $definition; |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | public function itShouldReturnSameInstanceAndTypeAsCallableReturns() |
| 189 | 189 | { |
| 190 | - $this['service'] = function () { |
|
| 190 | + $this['service'] = function() { |
|
| 191 | 191 | return new MockService(); |
| 192 | 192 | }; |
| 193 | 193 | $serviceOne = $this['service']->shouldHaveType('Spec\Yapeal\MockService'); |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | public function itShouldReturnTrueFromOffsetExistsForAnySetKey() |
| 204 | 204 | { |
| 205 | 205 | $this['param'] = 'value'; |
| 206 | - $this['service'] = function () { |
|
| 206 | + $this['service'] = function() { |
|
| 207 | 207 | return new MockService(); |
| 208 | 208 | }; |
| 209 | 209 | $this['null'] = null; |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | ->during('extend', |
| 244 | 244 | [ |
| 245 | 245 | $id, |
| 246 | - function () { |
|
| 246 | + function() { |
|
| 247 | 247 | } |
| 248 | 248 | ]); |
| 249 | 249 | } |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | if (version_compare(PHP_VERSION, '7.0.0', '>=')) { |
| 267 | 267 | throw new SkippingException('Unneeded on PHP 7.x or higher caught by TypeError'); |
| 268 | 268 | } |
| 269 | - $this['foo'] = function () { |
|
| 269 | + $this['foo'] = function() { |
|
| 270 | 270 | return 'foo'; |
| 271 | 271 | }; |
| 272 | 272 | $this->shouldThrow(new \InvalidArgumentException('Extension service definition is not a Closure or invokable object.')) |
@@ -298,24 +298,24 @@ discard block |
||
| 298 | 298 | ->during('extend', |
| 299 | 299 | [ |
| 300 | 300 | 'param', |
| 301 | - function () { |
|
| 301 | + function() { |
|
| 302 | 302 | } |
| 303 | 303 | ]); |
| 304 | 304 | $this['non_invokable'] = $this->shouldThrow(new \InvalidArgumentException('Identifier "non_invokable" does not contain an object definition.')) |
| 305 | 305 | ->during('extend', |
| 306 | 306 | [ |
| 307 | 307 | 'non_invokable', |
| 308 | - function () { |
|
| 308 | + function() { |
|
| 309 | 309 | } |
| 310 | 310 | ]); |
| 311 | 311 | } |
| 312 | 312 | public function itThrowsExceptionWhenTryingToExtendingFrozenService() |
| 313 | 313 | { |
| 314 | - $this['foo'] = function () { |
|
| 314 | + $this['foo'] = function() { |
|
| 315 | 315 | return 'foo'; |
| 316 | 316 | }; |
| 317 | 317 | $this['foo'] = $this->extend('foo', |
| 318 | - function ($foo) { |
|
| 318 | + function($foo) { |
|
| 319 | 319 | return "$foo.bar"; |
| 320 | 320 | }); |
| 321 | 321 | $this['foo']->shouldReturn('foo.bar'); |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | ->during('extend', |
| 324 | 324 | [ |
| 325 | 325 | 'foo', |
| 326 | - function ($foo) { |
|
| 326 | + function($foo) { |
|
| 327 | 327 | return "$foo.baz"; |
| 328 | 328 | } |
| 329 | 329 | ]); |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | public function itThrowsExceptionWhenTryingToGetOffsetAfterTheyHaveBeenUnset() |
| 332 | 332 | { |
| 333 | 333 | $this['param'] = 'value'; |
| 334 | - $this['service'] = function () { |
|
| 334 | + $this['service'] = function() { |
|
| 335 | 335 | return new MockService(); |
| 336 | 336 | }; |
| 337 | 337 | $this->keys() |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | } |
| 345 | 345 | public function itThrowsExceptionWhenTryingToOverWriteFrozenService() |
| 346 | 346 | { |
| 347 | - $this['foo'] = function () { |
|
| 347 | + $this['foo'] = function() { |
|
| 348 | 348 | return 'foo'; |
| 349 | 349 | }; |
| 350 | 350 | $this['foo']; |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | ->during('offsetSet', |
| 353 | 353 | [ |
| 354 | 354 | 'foo', |
| 355 | - function () { |
|
| 355 | + function() { |
|
| 356 | 356 | return 'bar'; |
| 357 | 357 | } |
| 358 | 358 | ]); |