@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /* |
| 6 | 6 | * This file is part of the Geocoder package. |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /* |
| 6 | 6 | * This file is part of the Geocoder package. |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | $pluginA->expects($this->once()) |
| 73 | 73 | ->method('handleQuery') |
| 74 | 74 | ->with($geocodeQuery, $this->isType('callable'), $this->isType('callable')) |
| 75 | - ->willReturnCallback(function (Query $query, callable $next, callable $first) { |
|
| 75 | + ->willReturnCallback(function(Query $query, callable $next, callable $first) { |
|
| 76 | 76 | return $next($query); |
| 77 | 77 | }); |
| 78 | 78 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $pluginA->expects($this->once()) |
| 104 | 104 | ->method('handleQuery') |
| 105 | 105 | ->with($reverseQuery, $this->isType('callable'), $this->isType('callable')) |
| 106 | - ->willReturnCallback(function (Query $query, callable $next, callable $first) { |
|
| 106 | + ->willReturnCallback(function(Query $query, callable $next, callable $first) { |
|
| 107 | 107 | return $next($query); |
| 108 | 108 | }); |
| 109 | 109 | |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $pluginA->expects($this->any()) |
| 132 | 132 | ->method('handleQuery') |
| 133 | 133 | ->with($geocodeQuery, $this->isType('callable'), $this->isType('callable')) |
| 134 | - ->willReturnCallback(function (Query $query, callable $next, callable $first) { |
|
| 134 | + ->willReturnCallback(function(Query $query, callable $next, callable $first) { |
|
| 135 | 135 | return $next($query); |
| 136 | 136 | }); |
| 137 | 137 | $pluginB = $this->getMockBuilder(Plugin::class) |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | $pluginB->expects($this->any()) |
| 142 | 142 | ->method('handleQuery') |
| 143 | 143 | ->with($geocodeQuery, $this->isType('callable'), $this->isType('callable')) |
| 144 | - ->willReturnCallback(function (Query $query, callable $next, callable $first) { |
|
| 144 | + ->willReturnCallback(function(Query $query, callable $next, callable $first) { |
|
| 145 | 145 | return $first($query); |
| 146 | 146 | }); |
| 147 | 147 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /* |
| 6 | 6 | * This file is part of the Geocoder package. |
@@ -22,10 +22,10 @@ discard block |
||
| 22 | 22 | public function testPlugin() |
| 23 | 23 | { |
| 24 | 24 | $query = GeocodeQuery::create('foo'); |
| 25 | - $first = function (Query $query) { |
|
| 25 | + $first = function(Query $query) { |
|
| 26 | 26 | $this->fail('Plugin should not restart the chain'); |
| 27 | 27 | }; |
| 28 | - $next = function (Query $query) { |
|
| 28 | + $next = function(Query $query) { |
|
| 29 | 29 | $this->assertEquals('sv', $query->getLocale()); |
| 30 | 30 | }; |
| 31 | 31 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /* |
| 6 | 6 | * This file is part of the Geocoder package. |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | ->getMock(); |
| 32 | 32 | $logger->expects($this->once()) |
| 33 | 33 | ->method('log') |
| 34 | - ->with('info', $this->callback(function ($message) { |
|
| 34 | + ->with('info', $this->callback(function($message) { |
|
| 35 | 35 | return false !== strstr($message, 'Got 0 results'); |
| 36 | 36 | })); |
| 37 | 37 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | ->getMock(); |
| 63 | 63 | $logger->expects($this->once()) |
| 64 | 64 | ->method('log') |
| 65 | - ->with('error', $this->callback(function ($message) { |
|
| 65 | + ->with('error', $this->callback(function($message) { |
|
| 66 | 66 | return false !== strstr($message, 'QuotaExceeded'); |
| 67 | 67 | })); |
| 68 | 68 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /* |
| 6 | 6 | * This file is part of the Geocoder package. |
@@ -22,10 +22,10 @@ discard block |
||
| 22 | 22 | public function testPlugin() |
| 23 | 23 | { |
| 24 | 24 | $query = GeocodeQuery::create('foo'); |
| 25 | - $first = function (Query $query) { |
|
| 25 | + $first = function(Query $query) { |
|
| 26 | 26 | $this->fail('Plugin should not restart the chain'); |
| 27 | 27 | }; |
| 28 | - $next = function (Query $query) { |
|
| 28 | + $next = function(Query $query) { |
|
| 29 | 29 | $this->assertEquals(4711, $query->getLimit()); |
| 30 | 30 | }; |
| 31 | 31 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /* |
| 6 | 6 | * This file is part of the Geocoder package. |
@@ -23,10 +23,10 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | $query = GeocodeQuery::create('xxx'); |
| 25 | 25 | $query = $query->withData('default', 'value'); |
| 26 | - $first = function (Query $query) { |
|
| 26 | + $first = function(Query $query) { |
|
| 27 | 27 | $this->fail('Plugin should not restart the chain'); |
| 28 | 28 | }; |
| 29 | - $next = function (Query $query) { |
|
| 29 | + $next = function(Query $query) { |
|
| 30 | 30 | $this->assertEquals('bar', $query->getData('foo')); |
| 31 | 31 | $this->assertEquals('value', $query->getData('default')); |
| 32 | 32 | }; |
@@ -39,10 +39,10 @@ discard block |
||
| 39 | 39 | { |
| 40 | 40 | $query = GeocodeQuery::create('xxx'); |
| 41 | 41 | $query = $query->withData('default', 'value'); |
| 42 | - $first = function (Query $query) { |
|
| 42 | + $first = function(Query $query) { |
|
| 43 | 43 | $this->fail('Plugin should not restart the chain'); |
| 44 | 44 | }; |
| 45 | - $next = function (Query $query) { |
|
| 45 | + $next = function(Query $query) { |
|
| 46 | 46 | $this->assertEquals('bar', $query->getData('foo')); |
| 47 | 47 | $this->assertEquals('new value', $query->getData('default')); |
| 48 | 48 | }; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /* |
| 6 | 6 | * This file is part of the Geocoder package. |
@@ -39,10 +39,10 @@ discard block |
||
| 39 | 39 | ->with('v4'.$queryString, 'result', $ttl) |
| 40 | 40 | ->willReturn(true); |
| 41 | 41 | |
| 42 | - $first = function (Query $query) { |
|
| 42 | + $first = function(Query $query) { |
|
| 43 | 43 | $this->fail('Plugin should not restart the chain'); |
| 44 | 44 | }; |
| 45 | - $next = function (Query $query) { |
|
| 45 | + $next = function(Query $query) { |
|
| 46 | 46 | return 'result'; |
| 47 | 47 | }; |
| 48 | 48 | |
@@ -65,10 +65,10 @@ discard block |
||
| 65 | 65 | ->willReturn('result'); |
| 66 | 66 | $cache->expects($this->never())->method('set'); |
| 67 | 67 | |
| 68 | - $first = function (Query $query) { |
|
| 68 | + $first = function(Query $query) { |
|
| 69 | 69 | $this->fail('Plugin should not restart the chain'); |
| 70 | 70 | }; |
| 71 | - $next = function (Query $query) { |
|
| 71 | + $next = function(Query $query) { |
|
| 72 | 72 | $this->fail('Plugin not call $next on cache hit'); |
| 73 | 73 | }; |
| 74 | 74 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /* |
| 6 | 6 | * This file is part of the Geocoder package. |
@@ -25,10 +25,10 @@ discard block |
||
| 25 | 25 | { |
| 26 | 26 | $bounds = new Bounds(4, 7, 1, 1); |
| 27 | 27 | $query = GeocodeQuery::create('foo'); |
| 28 | - $first = function (Query $query) { |
|
| 28 | + $first = function(Query $query) { |
|
| 29 | 29 | $this->fail('Plugin should not restart the chain'); |
| 30 | 30 | }; |
| 31 | - $next = function (GeocodeQuery $query) use ($bounds) { |
|
| 31 | + $next = function(GeocodeQuery $query) use ($bounds) { |
|
| 32 | 32 | $this->assertEquals($bounds, $query->getBounds()); |
| 33 | 33 | }; |
| 34 | 34 | |
@@ -40,10 +40,10 @@ discard block |
||
| 40 | 40 | { |
| 41 | 41 | $bounds = new Bounds(4, 7, 1, 1); |
| 42 | 42 | $query = ReverseQuery::fromCoordinates(71, 11); |
| 43 | - $first = function (Query $query) { |
|
| 43 | + $first = function(Query $query) { |
|
| 44 | 44 | $this->fail('Plugin should not restart the chain'); |
| 45 | 45 | }; |
| 46 | - $next = function (Query $query) use ($bounds) { |
|
| 46 | + $next = function(Query $query) use ($bounds) { |
|
| 47 | 47 | $this->assertTrue(true, 'We should not fail on ReverseQuery'); |
| 48 | 48 | }; |
| 49 | 49 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | /* |
| 6 | 6 | * This file is part of the Geocoder package. |
@@ -42,12 +42,12 @@ discard block |
||
| 42 | 42 | $startTime = microtime(true); |
| 43 | 43 | $logger = $this->logger; |
| 44 | 44 | |
| 45 | - return $next($query)->then(function (Collection $result) use ($logger, $query, $startTime) { |
|
| 45 | + return $next($query)->then(function(Collection $result) use ($logger, $query, $startTime) { |
|
| 46 | 46 | $duration = (microtime(true) - $startTime) * 1000; |
| 47 | 47 | $this->logger->info(sprintf('[Geocoder] Got %d results in %0.2f ms for query %s', count($result), $duration, $query->__toString())); |
| 48 | 48 | |
| 49 | 49 | return $result; |
| 50 | - }, function (Exception $exception) use ($logger, $query, $startTime) { |
|
| 50 | + }, function(Exception $exception) use ($logger, $query, $startTime) { |
|
| 51 | 51 | $duration = (microtime(true) - $startTime) * 1000; |
| 52 | 52 | $this->logger->error(sprintf('[Geocoder] Failed with %s after %0.2f ms for query %s', get_class($exception), $duration, $query->__toString())); |
| 53 | 53 | |