@@ -43,7 +43,7 @@ |
||
43 | 43 | |
44 | 44 | /** |
45 | 45 | * @param \Swift_Events_EventObject $evt |
46 | - * @param $target |
|
46 | + * @param string $target |
|
47 | 47 | * @return string |
48 | 48 | */ |
49 | 49 | protected function normalizeEventName(Swift_Events_EventObject $evt, $target) |
@@ -223,7 +223,7 @@ |
||
223 | 223 | /** |
224 | 224 | * Returns proper transport closure factory |
225 | 225 | * |
226 | - * @param $transportName |
|
226 | + * @param string $transportName |
|
227 | 227 | * @return \Closure |
228 | 228 | */ |
229 | 229 | protected function getTransport($transportName) |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $spoolRealTransport = $this->getTransport($transport); |
154 | 154 | |
155 | 155 | $this->eventDispatcher->attach(self::SPOOL_SEND_EVENT, 'send.swiftmailer.spooled', |
156 | - function () use ($spoolRealTransport, $spool) { |
|
156 | + function() use ($spoolRealTransport, $spool) { |
|
157 | 157 | $failedRecipients = []; |
158 | 158 | $spool->getSpool()->flushQueue($spoolRealTransport(), $failedRecipients); |
159 | 159 | |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $eventDispatcherAdapter = $this->eventDispatcherAdapter; |
255 | 255 | switch ($transport) { |
256 | 256 | case('smtp'): |
257 | - $closure = function () use ($config) { |
|
257 | + $closure = function() use ($config) { |
|
258 | 258 | $transportInstance = new Swift_SmtpTransport( |
259 | 259 | $config->get('host'), |
260 | 260 | $config->get('port'), |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | }; |
285 | 285 | break; |
286 | 286 | case('mail'): |
287 | - $closure = function () use ($eventDispatcherAdapter) { |
|
287 | + $closure = function() use ($eventDispatcherAdapter) { |
|
288 | 288 | return new Swift_Transport_MailTransport( |
289 | 289 | new Swift_Transport_SimpleMailInvoker(), |
290 | 290 | $eventDispatcherAdapter |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | }; |
293 | 293 | break; |
294 | 294 | case('null'): |
295 | - $closure = function () use ($eventDispatcherAdapter) { |
|
295 | + $closure = function() use ($eventDispatcherAdapter) { |
|
296 | 296 | return new Swift_Transport_NullTransport($eventDispatcherAdapter); |
297 | 297 | }; |
298 | 298 | break; |
@@ -78,7 +78,7 @@ |
||
78 | 78 | /** |
79 | 79 | * Route constructor. |
80 | 80 | * |
81 | - * @param array $methods |
|
81 | + * @param string[] $methods |
|
82 | 82 | * @param string $path |
83 | 83 | * @param string $responder |
84 | 84 | */ |
@@ -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 | } |
@@ -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())); |
@@ -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 |
@@ -28,10 +28,10 @@ |
||
28 | 28 | |
29 | 29 | $pool->shouldReceive('getItem')->with('key')->andReturn( |
30 | 30 | Mockery::mock(\Psr\Cache\CacheItemInterface::class) |
31 | - ->shouldReceive('get') |
|
32 | - ->withNoArgs() |
|
33 | - ->andReturn('value') |
|
34 | - ->getMock() |
|
31 | + ->shouldReceive('get') |
|
32 | + ->withNoArgs() |
|
33 | + ->andReturn('value') |
|
34 | + ->getMock() |
|
35 | 35 | ); |
36 | 36 | $this->assertSame('value', $cache->get('key')); |
37 | 37 |
@@ -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 |