@@ -19,7 +19,7 @@ |
||
| 19 | 19 | public function getMatchers() |
| 20 | 20 | { |
| 21 | 21 | return [ |
| 22 | - 'containKeys' => function ($subject, ...$keys) { |
|
| 22 | + 'containKeys' => function($subject, ...$keys) { |
|
| 23 | 23 | foreach ($keys as $key) { |
| 24 | 24 | if (!array_key_exists($key, $subject[0])) { |
| 25 | 25 | return false; |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | public function getMatchers() |
| 15 | 15 | { |
| 16 | 16 | return [ |
| 17 | - 'beEmpty' => function ($subject) { |
|
| 17 | + 'beEmpty' => function($subject) { |
|
| 18 | 18 | return empty($subject); |
| 19 | 19 | }, |
| 20 | 20 | ]; |
@@ -48,15 +48,15 @@ |
||
| 48 | 48 | ResponseInterface $response, |
| 49 | 49 | ResponseInterface $lastResponse |
| 50 | 50 | ) { |
| 51 | - $m1->process($request, Argument::type(Delegate::class))->will(function ($args) use ($lastResponse, $response) { |
|
| 51 | + $m1->process($request, Argument::type(Delegate::class))->will(function($args) use ($lastResponse, $response) { |
|
| 52 | 52 | $args[1]->next($args[0]); |
| 53 | 53 | |
| 54 | 54 | return $lastResponse; |
| 55 | 55 | })->shouldBeCalled(); |
| 56 | - $m2->process($request, Argument::type(Delegate::class))->will(function ($args) { |
|
| 56 | + $m2->process($request, Argument::type(Delegate::class))->will(function($args) { |
|
| 57 | 57 | return $args[1]->next($args[0]); |
| 58 | 58 | })->shouldBeCalled(); |
| 59 | - $m3->process($request, Argument::type(Delegate::class))->will(function ($args) { |
|
| 59 | + $m3->process($request, Argument::type(Delegate::class))->will(function($args) { |
|
| 60 | 60 | return $args[1]->next($args[0]); |
| 61 | 61 | })->shouldBeCalled(); |
| 62 | 62 | $delegate->next($request)->willReturn($response)->shouldBeCalled(); |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | function it_collects_route_by_callback() |
| 16 | 16 | { |
| 17 | 17 | $route = new Route(['GET'], '/url', 'handler'); |
| 18 | - $group = $this->collect(function (\Venta\Contracts\Routing\RouteGroup $group) use ($route) { |
|
| 18 | + $group = $this->collect(function(\Venta\Contracts\Routing\RouteGroup $group) use ($route) { |
|
| 19 | 19 | $group->addRoute($route); |
| 20 | 20 | })->shouldBeAnInstanceOf(\Venta\Contracts\Routing\RouteGroup::class); |
| 21 | 21 | assert(in_array($route, $group->getRoutes())); |
@@ -321,8 +321,7 @@ |
||
| 321 | 321 | { |
| 322 | 322 | $route = clone $this; |
| 323 | 323 | $route->path = $prefix == '/' || $prefix == '' ? |
| 324 | - $route->path : |
|
| 325 | - sprintf('/%s/%s', trim($prefix, '/'), ltrim($route->path, '/')); |
|
| 324 | + $route->path : sprintf('/%s/%s', trim($prefix, '/'), ltrim($route->path, '/')); |
|
| 326 | 325 | |
| 327 | 326 | return $route; |
| 328 | 327 | } |
@@ -17,11 +17,11 @@ discard block |
||
| 17 | 17 | $eventName = ltrim(get_class($event), '\\'); |
| 18 | 18 | $dispatcher = new \Venta\Event\EventDispatcher; |
| 19 | 19 | |
| 20 | - $dispatcher->addListener($eventName, function (\Venta\Contracts\Event\Event $event) { |
|
| 20 | + $dispatcher->addListener($eventName, function(\Venta\Contracts\Event\Event $event) { |
|
| 21 | 21 | $event->setData('foo', 'bar'); |
| 22 | 22 | }); |
| 23 | 23 | |
| 24 | - $dispatcher->addListener($eventName, function (\Venta\Contracts\Event\Event $event) { |
|
| 24 | + $dispatcher->addListener($eventName, function(\Venta\Contracts\Event\Event $event) { |
|
| 25 | 25 | $event->setData('boo', 'far'); |
| 26 | 26 | }); |
| 27 | 27 | |
@@ -41,15 +41,15 @@ discard block |
||
| 41 | 41 | $eventName = ltrim(get_class($event), '\\'); |
| 42 | 42 | $dispatcher = new \Venta\Event\EventDispatcher; |
| 43 | 43 | |
| 44 | - $dispatcher->addListener($eventName, function (\Venta\Contracts\Event\Event $event) { |
|
| 44 | + $dispatcher->addListener($eventName, function(\Venta\Contracts\Event\Event $event) { |
|
| 45 | 45 | $event->setData('foo', 'bar'); |
| 46 | 46 | }); |
| 47 | 47 | |
| 48 | - $dispatcher->addListener($eventName, function (\Venta\Contracts\Event\Event $event) { |
|
| 48 | + $dispatcher->addListener($eventName, function(\Venta\Contracts\Event\Event $event) { |
|
| 49 | 49 | $event->stopPropagation(); |
| 50 | 50 | }); |
| 51 | 51 | |
| 52 | - $dispatcher->addListener($eventName, function (\Venta\Contracts\Event\Event $event) { |
|
| 52 | + $dispatcher->addListener($eventName, function(\Venta\Contracts\Event\Event $event) { |
|
| 53 | 53 | $event->setData('boo', 'far'); |
| 54 | 54 | }); |
| 55 | 55 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $pool = Mockery::mock(\Psr\Cache\CacheItemPoolInterface::class); |
| 50 | 50 | $cache = new \Venta\Cache\Cache($pool); |
| 51 | 51 | |
| 52 | - $pool->shouldReceive('save')->with(Mockery::on(function (\Cache\Adapter\Common\CacheItem $cacheItem) { |
|
| 52 | + $pool->shouldReceive('save')->with(Mockery::on(function(\Cache\Adapter\Common\CacheItem $cacheItem) { |
|
| 53 | 53 | $this->assertSame('key', $cacheItem->getKey()); |
| 54 | 54 | $this->assertEquals('2030-01-01 00:00:00', $cacheItem->getExpirationDate()->format('Y-m-d H:i:s')); |
| 55 | 55 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $pool = Mockery::mock(\Psr\Cache\CacheItemPoolInterface::class); |
| 68 | 68 | $cache = new \Venta\Cache\Cache($pool); |
| 69 | 69 | |
| 70 | - $pool->shouldReceive('save')->with(Mockery::on(function (\Cache\Adapter\Common\CacheItem $cacheItem) { |
|
| 70 | + $pool->shouldReceive('save')->with(Mockery::on(function(\Cache\Adapter\Common\CacheItem $cacheItem) { |
|
| 71 | 71 | $this->assertSame('key', $cacheItem->getKey()); |
| 72 | 72 | $this->assertEquals(time() + 10, $cacheItem->getExpirationDate()->getTimestamp()); |
| 73 | 73 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | $interval = new DateInterval('P1M'); |
| 89 | 89 | |
| 90 | - $pool->shouldReceive('save')->with(Mockery::on(function (\Cache\Adapter\Common\CacheItem $cacheItem) use ( |
|
| 90 | + $pool->shouldReceive('save')->with(Mockery::on(function(\Cache\Adapter\Common\CacheItem $cacheItem) use ( |
|
| 91 | 91 | $interval |
| 92 | 92 | ) { |
| 93 | 93 | $this->assertSame('key', $cacheItem->getKey()); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | $pool = Mockery::mock(\Psr\Cache\CacheItemPoolInterface::class); |
| 111 | 111 | $cache = new \Venta\Cache\Cache($pool); |
| 112 | 112 | |
| 113 | - $pool->shouldReceive('save')->with(Mockery::on(function (\Cache\Adapter\Common\CacheItem $cacheItem) { |
|
| 113 | + $pool->shouldReceive('save')->with(Mockery::on(function(\Cache\Adapter\Common\CacheItem $cacheItem) { |
|
| 114 | 114 | $this->assertSame('key', $cacheItem->getKey()); |
| 115 | 115 | $this->assertNull($cacheItem->getExpirationDate()); |
| 116 | 116 | |
@@ -17,13 +17,13 @@ |
||
| 17 | 17 | public function getMatchers() |
| 18 | 18 | { |
| 19 | 19 | return [ |
| 20 | - 'matchJson' => function ($subject, $json) { |
|
| 20 | + 'matchJson' => function($subject, $json) { |
|
| 21 | 21 | return json_encode($subject) == $json; |
| 22 | 22 | }, |
| 23 | - 'havePropertyWithValue' => function ($subject, $key, $value) { |
|
| 23 | + 'havePropertyWithValue' => function($subject, $key, $value) { |
|
| 24 | 24 | return $subject->{$key} === $value; |
| 25 | 25 | }, |
| 26 | - 'haveProperty' => function ($subject, $key) { |
|
| 26 | + 'haveProperty' => function($subject, $key) { |
|
| 27 | 27 | return property_exists($subject, $key); |
| 28 | 28 | }, |
| 29 | 29 | ]; |
@@ -218,7 +218,7 @@ |
||
| 218 | 218 | $this->assertSame('value', $result->get('key')); |
| 219 | 219 | $this->assertSame('zxcv', $result->get('map')->get('name')); |
| 220 | 220 | $this->assertSame('poiuyt', $result->get('map')->get('other')); |
| 221 | - $this->assertSame(['value 1', 'value 2', 'value 3', 'value 4', 'value 5',], $result->get('vector')->toArray()); |
|
| 221 | + $this->assertSame(['value 1', 'value 2', 'value 3', 'value 4', 'value 5', ], $result->get('vector')->toArray()); |
|
| 222 | 222 | $this->assertSame('is overwritten', $result->get('this')); |
| 223 | 223 | $this->assertSame('plain string', $result->get('another')); |
| 224 | 224 | } |