From c923d8599a28d2d01653a398f68809afd36282ba Mon Sep 17 00:00:00 2001 From: William DURAND Date: Tue, 22 Oct 2013 15:05:24 +0200 Subject: [PATCH] Fix CS --- src/Geocoder/Dumper/GeoJsonDumper.php | 2 +- src/Geocoder/Provider/AbstractProvider.php | 2 +- src/Geocoder/Provider/MaxMindProvider.php | 2 +- src/Geocoder/Provider/YandexProvider.php | 2 +- src/autoload.php | 2 +- tests/Geocoder/Tests/Provider/ChainProviderTest.php | 8 ++++---- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Geocoder/Dumper/GeoJsonDumper.php b/src/Geocoder/Dumper/GeoJsonDumper.php index 609516966..3629245c3 100644 --- a/src/Geocoder/Dumper/GeoJsonDumper.php +++ b/src/Geocoder/Dumper/GeoJsonDumper.php @@ -24,7 +24,7 @@ class GeoJsonDumper implements DumperInterface */ public function dump(ResultInterface $result) { - $properties = array_filter($result->toArray(), function($val) { + $properties = array_filter($result->toArray(), function ($val) { return $val !== null; }); diff --git a/src/Geocoder/Provider/AbstractProvider.php b/src/Geocoder/Provider/AbstractProvider.php index 979ead092..7447603c4 100644 --- a/src/Geocoder/Provider/AbstractProvider.php +++ b/src/Geocoder/Provider/AbstractProvider.php @@ -159,7 +159,7 @@ protected function getLocalhostDefaults() */ protected function fixEncoding(array $results) { - return array_map(function($value) { + return array_map(function ($value) { return is_string($value) ? utf8_encode($value) : $value; }, $results); } diff --git a/src/Geocoder/Provider/MaxMindProvider.php b/src/Geocoder/Provider/MaxMindProvider.php index 013c28bda..f62c89644 100644 --- a/src/Geocoder/Provider/MaxMindProvider.php +++ b/src/Geocoder/Provider/MaxMindProvider.php @@ -133,7 +133,7 @@ protected function executeQuery($query) } $data = array_combine($fields, $data); - $data = array_map(function($value) { return '' === $value ? null : $value; }, $data); + $data = array_map(function ($value) { return '' === $value ? null : $value; }, $data); if (empty($data['country']) && !empty($data['countryCode'])) { $data['country'] = $this->countryCodeToCountryName($data['countryCode']); diff --git a/src/Geocoder/Provider/YandexProvider.php b/src/Geocoder/Provider/YandexProvider.php index beb2cffab..6f44d71d7 100644 --- a/src/Geocoder/Provider/YandexProvider.php +++ b/src/Geocoder/Provider/YandexProvider.php @@ -113,7 +113,7 @@ protected function executeQuery($query) array_walk_recursive( $item['GeoObject'], - function($value, $key) use (&$details) {$details[$key] = $value;} + function ($value, $key) use (&$details) {$details[$key] = $value;} ); if (! empty($details['lowerCorner'])) { diff --git a/src/autoload.php b/src/autoload.php index a6fd44be7..7e8d2d840 100644 --- a/src/autoload.php +++ b/src/autoload.php @@ -7,7 +7,7 @@ * Code inspired from the SplClassLoader RFC * @see https://wiki.php.net/rfc/splclassloader#example_implementation */ -spl_autoload_register(function($className) { +spl_autoload_register(function ($className) { $className = ltrim($className, '\\'); if (0 != strpos($className, 'Geocoder')) { return false; diff --git a/tests/Geocoder/Tests/Provider/ChainProviderTest.php b/tests/Geocoder/Tests/Provider/ChainProviderTest.php index e67ca49d4..95046cc28 100644 --- a/tests/Geocoder/Tests/Provider/ChainProviderTest.php +++ b/tests/Geocoder/Tests/Provider/ChainProviderTest.php @@ -30,7 +30,7 @@ public function testGetReversedData() $mockOne = $this->getMock('Geocoder\\Provider\\ProviderInterface'); $mockOne->expects($this->once()) ->method('getReversedData') - ->will($this->returnCallback(function() { throw new \Exception; })); + ->will($this->returnCallback(function () { throw new \Exception; })); $mockTwo = $this->getMock('Geocoder\\Provider\\ProviderInterface'); $mockTwo->expects($this->once()) @@ -48,7 +48,7 @@ public function testChainProviderReverseThrowsChainNoResultException() $mockOne = $this->getMock('Geocoder\\Provider\\ProviderInterface'); $mockOne->expects($this->exactly(2)) ->method('getReversedData') - ->will($this->returnCallback(function() { throw new \Exception; })); + ->will($this->returnCallback(function () { throw new \Exception; })); $chain = new ChainProvider(array($mockOne, $mockOne)); @@ -64,7 +64,7 @@ public function testGetGeocodedData() $mockOne = $this->getMock('Geocoder\\Provider\\ProviderInterface'); $mockOne->expects($this->once()) ->method('getGeocodedData') - ->will($this->returnCallback(function() { throw new \Exception; })); + ->will($this->returnCallback(function () { throw new \Exception; })); $mockTwo = $this->getMock('Geocoder\\Provider\\ProviderInterface'); $mockTwo->expects($this->once()) @@ -82,7 +82,7 @@ public function testChainProviderGeocodeThrowsChainNoResultException() $mockOne = $this->getMock('Geocoder\\Provider\\ProviderInterface'); $mockOne->expects($this->exactly(2)) ->method('getGeocodedData') - ->will($this->returnCallback(function() { throw new \Exception; })); + ->will($this->returnCallback(function () { throw new \Exception; })); $chain = new ChainProvider(array($mockOne, $mockOne));