Skip to content

Commit 01d181d

Browse files
committed
CS
1 parent 115959f commit 01d181d

26 files changed

+106
-125
lines changed

BazingaGeocoderBundle.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
*
88
* @license MIT License
99
*/
10-
1110
namespace Bazinga\Bundle\GeocoderBundle;
1211

1312
use Symfony\Component\DependencyInjection\ContainerBuilder;
1413
use Symfony\Component\HttpKernel\Bundle\Bundle;
15-
1614
use Bazinga\Bundle\GeocoderBundle\DependencyInjection\Compiler\AddProvidersPass;
1715
use Bazinga\Bundle\GeocoderBundle\DependencyInjection\Compiler\AddDumperPass;
1816
use Bazinga\Bundle\GeocoderBundle\DependencyInjection\Compiler\LoggablePass;

Command/GeocodeCommand.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*
88
* @license MIT License
99
*/
10-
1110
namespace Bazinga\Bundle\GeocoderBundle\Command;
1211

1312
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
@@ -22,7 +21,7 @@
2221
class GeocodeCommand extends ContainerAwareCommand
2322
{
2423
/**
25-
* {@inheritDoc}
24+
* {@inheritdoc}
2625
*/
2726
protected function configure()
2827
{
@@ -43,7 +42,7 @@ protected function configure()
4342
}
4443

4544
/**
46-
* {@inheritDoc}
45+
* {@inheritdoc}
4746
*/
4847
protected function execute(InputInterface $input, OutputInterface $output)
4948
{
@@ -55,7 +54,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
5554
}
5655

5756
$result = $geocoder->geocode($input->getArgument('address'));
58-
$data = $result->toArray();
57+
$data = $result->toArray();
5958

6059
$max = 0;
6160

DataCollector/GeocoderDataCollector.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*
88
* @license MIT License
99
*/
10-
1110
namespace Bazinga\Bundle\GeocoderBundle\DataCollector;
1211

1312
use Bazinga\Bundle\GeocoderBundle\Logger\GeocoderLogger;
@@ -26,7 +25,6 @@ class GeocoderDataCollector extends DataCollector
2625
protected $logger;
2726

2827
/**
29-
*
3028
* @param GeocoderLogger $logger
3129
*/
3230
public function __construct(GeocoderLogger $logger)
@@ -57,7 +55,7 @@ public function getRequests()
5755
/**
5856
* Returns the number of collected requests.
5957
*
60-
* @return integer
58+
* @return int
6159
*/
6260
public function getRequestsCount()
6361
{

DependencyInjection/BazingaGeocoderExtension.php

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*
88
* @license MIT License
99
*/
10-
1110
namespace Bazinga\Bundle\GeocoderBundle\DependencyInjection;
1211

1312
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
@@ -19,7 +18,7 @@
1918
use Symfony\Component\Config\Definition\Processor;
2019

2120
/**
22-
* William Durand <william.durand1@gmail.com>
21+
* William Durand <william.durand1@gmail.com>.
2322
*/
2423
class BazingaGeocoderExtension extends Extension
2524
{
@@ -29,9 +28,9 @@ public function load(array $configs, ContainerBuilder $container)
2928
{
3029
$this->container = $container;
3130

32-
$processor = new Processor();
33-
$configuration = new Configuration();
34-
$config = $processor->processConfiguration($configuration, $configs);
31+
$processor = new Processor();
32+
$configuration = new Configuration();
33+
$config = $processor->processConfiguration($configuration, $configs);
3534

3635
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
3736
$loader->load('services.xml');
@@ -77,7 +76,7 @@ public function load(array $configs, ContainerBuilder $container)
7776
$ipInfoDbParams = $config['providers']['ip_info_db'];
7877

7978
$this->addProvider('ip_info_db', array(
80-
$ipInfoDbParams['api_key']
79+
$ipInfoDbParams['api_key'],
8180
));
8281
}
8382

@@ -108,7 +107,7 @@ public function load(array $configs, ContainerBuilder $container)
108107
$openstreetMapsParams = $config['providers']['openstreetmap'];
109108

110109
$this->addProvider('openstreetmap', array(
111-
$openstreetMapsParams['locale']
110+
$openstreetMapsParams['locale'],
112111
));
113112
}
114113

@@ -120,7 +119,7 @@ public function load(array $configs, ContainerBuilder $container)
120119
$mapQuestParams = $config['providers']['mapquest'];
121120

122121
$this->addProvider('mapquest', array(
123-
$mapQuestParams['api_key']
122+
$mapQuestParams['api_key'],
124123
));
125124
}
126125

@@ -140,7 +139,7 @@ public function load(array $configs, ContainerBuilder $container)
140139
$ignOpenlsParams = $config['providers']['ign_openls'];
141140

142141
$this->addProvider('ign_openls', array(
143-
$ignOpenlsParams['api_key']
142+
$ignOpenlsParams['api_key'],
144143
));
145144
}
146145

@@ -153,15 +152,15 @@ public function load(array $configs, ContainerBuilder $container)
153152

154153
$this->addProvider('yandex', array(
155154
$yandexParams['locale'],
156-
$yandexParams['toponym']
155+
$yandexParams['toponym'],
157156
));
158157
}
159158

160159
if (isset($config['providers']['geo_ips'])) {
161160
$geoIpsParams = $config['providers']['geo_ips'];
162161

163162
$this->addProvider('geo_ips', array(
164-
$geoIpsParams['api_key']
163+
$geoIpsParams['api_key'],
165164
));
166165
}
167166

@@ -173,7 +172,7 @@ public function load(array $configs, ContainerBuilder $container)
173172
$maxmindParams = $config['providers']['maxmind'];
174173

175174
$this->addProvider('maxmind', array(
176-
$maxmindParams['api_key']
175+
$maxmindParams['api_key'],
177176
));
178177
}
179178

@@ -206,8 +205,8 @@ public function load(array $configs, ContainerBuilder $container)
206205
}
207206

208207
if (isset($config['providers']['cache'])) {
209-
$params = $config['providers']['cache'];
210-
$cache = new Reference($params['adapter']);
208+
$params = $config['providers']['cache'];
209+
$cache = new Reference($params['adapter']);
211210
$fallback = new Reference('bazinga_geocoder.provider.'.$params['provider']);
212211

213212
$provider = new Definition(
@@ -241,7 +240,7 @@ public function load(array $configs, ContainerBuilder $container)
241240
foreach ($config['providers']['chain']['providers'] as $name) {
242241
if ($this->container->hasDefinition('bazinga_geocoder.provider.'.$name)) {
243242
$chainProvider->addMethodCall('addProvider', array(
244-
$this->container->getDefinition('bazinga_geocoder.provider.'.$name)
243+
$this->container->getDefinition('bazinga_geocoder.provider.'.$name),
245244
));
246245
} else {
247246
$chainProvider->addMethodCall('addProvider', array(new Reference($name)));

DependencyInjection/Compiler/AddDumperPass.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*
88
* @license MIT License
99
*/
10-
1110
namespace Bazinga\Bundle\GeocoderBundle\DependencyInjection\Compiler;
1211

1312
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
@@ -19,7 +18,7 @@
1918
class AddDumperPass implements CompilerPassInterface
2019
{
2120
/**
22-
* {@inheritDoc}
21+
* {@inheritdoc}
2322
*/
2423
public function process(ContainerBuilder $container)
2524
{

DependencyInjection/Compiler/AddProvidersPass.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*
88
* @license MIT License
99
*/
10-
1110
namespace Bazinga\Bundle\GeocoderBundle\DependencyInjection\Compiler;
1211

1312
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
@@ -41,7 +40,7 @@ public function process(ContainerBuilder $container)
4140
$array[] = new Reference($providerId);
4241
}
4342

44-
$geocoderDefinition =$container->getDefinition('bazinga_geocoder.geocoder');
43+
$geocoderDefinition = $container->getDefinition('bazinga_geocoder.geocoder');
4544
$geocoderDefinition->addMethodCall('registerProviders', array($array));
4645

4746
if ($container->hasParameter('bazinga_geocoder.default_provider')) {

DependencyInjection/Compiler/LoggablePass.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*
88
* @license MIT License
99
*/
10-
1110
namespace Bazinga\Bundle\GeocoderBundle\DependencyInjection\Compiler;
1211

1312
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
@@ -20,7 +19,7 @@
2019
class LoggablePass implements CompilerPassInterface
2120
{
2221
/**
23-
* {@inheritDoc}
22+
* {@inheritdoc}
2423
*/
2524
public function process(ContainerBuilder $container)
2625
{

DependencyInjection/Configuration.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*
88
* @license MIT License
99
*/
10-
1110
namespace Bazinga\Bundle\GeocoderBundle\DependencyInjection;
1211

1312
use Symfony\Component\Config\Definition\Builder\TreeBuilder;

Doctrine/ORM/GeocoderListener.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use Doctrine\Common\EventSubscriber;
66
use Doctrine\ORM\Events;
77
use Doctrine\ORM\Event\OnFlushEventArgs;
8-
98
use Bazinga\Bundle\GeocoderBundle\Mapping\Driver\DriverInterface;
109
use Geocoder\Geocoder;
1110

@@ -20,17 +19,17 @@ class GeocoderListener implements EventSubscriber
2019

2120
public function __construct(Geocoder $geocoder, DriverInterface $driver)
2221
{
23-
$this->driver = $driver;
22+
$this->driver = $driver;
2423
$this->geocoder = $geocoder;
2524
}
2625

2726
/**
28-
* {@inheritDoc}
27+
* {@inheritdoc}
2928
*/
3029
public function getSubscribedEvents()
3130
{
3231
return array(
33-
Events::onFlush
32+
Events::onFlush,
3433
);
3534
}
3635

@@ -69,8 +68,8 @@ public function onFlush(OnFlushEventArgs $args)
6968
private function geocodeEntity($entity)
7069
{
7170
$metadata = $this->driver->loadMetadataFromObject($entity);
72-
$address = $metadata->addressProperty->getValue($entity);
73-
$result = $this->geocoder->geocode($address);
71+
$address = $metadata->addressProperty->getValue($entity);
72+
$result = $this->geocoder->geocode($address);
7473

7574
$metadata->latitudeProperty->setValue($entity, $result['latitude']);
7675
$metadata->longitudeProperty->setValue($entity, $result['longitude']);

DumperManager.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
2+
23
/**
34
* This file is part of the BazingaGeocoderBundle package.
45
* For the full copyright and license information, please view the LICENSE
56
* file that was distributed with this source code.
67
*
78
* @license MIT License
89
*/
9-
1010
namespace Bazinga\Bundle\GeocoderBundle;
1111

1212
use Geocoder\Dumper\DumperInterface;
@@ -22,7 +22,7 @@ class DumperManager
2222
private $dumpers;
2323

2424
/**
25-
* Constructor
25+
* Constructor.
2626
*
2727
* @param array $dumpers
2828
*/
@@ -36,7 +36,7 @@ public function __construct(array $dumpers = array())
3636
}
3737

3838
/**
39-
* Get a dumper
39+
* Get a dumper.
4040
*
4141
* @param string $name The name of the dumper
4242
*
@@ -54,7 +54,7 @@ public function get($name)
5454
}
5555

5656
/**
57-
* Sets a dumper
57+
* Sets a dumper.
5858
*
5959
* @param string $name The name
6060
* @param DumperInterface $dumper The dumper instance
@@ -65,7 +65,7 @@ public function set($name, DumperInterface $dumper)
6565
}
6666

6767
/**
68-
* Remove a dumper instance from the manager
68+
* Remove a dumper instance from the manager.
6969
*
7070
* @param string $name The name of the dumper
7171
*

0 commit comments

Comments
 (0)