Skip to content

Commit

Permalink
Updated namespace to Bazinga\GeocoderBundle (#139)
Browse files Browse the repository at this point in the history
* Updated namespace from Bazinga\Bundle\GeocoderBundle to Bazinga\GeocoderBundle

* Update all namespaces

* Use class constants

* Stylefix
  • Loading branch information
Nyholm committed Jul 16, 2017
1 parent 709dbb3 commit f12a689
Show file tree
Hide file tree
Showing 35 changed files with 61 additions and 61 deletions.
6 changes: 3 additions & 3 deletions BazingaGeocoderBundle.php
Expand Up @@ -8,10 +8,10 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle;
namespace Bazinga\GeocoderBundle;

use Bazinga\Bundle\GeocoderBundle\DependencyInjection\Compiler\AddProvidersPass;
use Bazinga\Bundle\GeocoderBundle\DependencyInjection\Compiler\ProfilerPass;
use Bazinga\GeocoderBundle\DependencyInjection\Compiler\AddProvidersPass;
use Bazinga\GeocoderBundle\DependencyInjection\Compiler\ProfilerPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

Expand Down
2 changes: 1 addition & 1 deletion Command/GeocodeCommand.php
Expand Up @@ -8,7 +8,7 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\Command;
namespace Bazinga\GeocoderBundle\Command;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
Expand Down
2 changes: 1 addition & 1 deletion DataCollector/GeocoderDataCollector.php
Expand Up @@ -8,7 +8,7 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\DataCollector;
namespace Bazinga\GeocoderBundle\DataCollector;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
Expand Down
2 changes: 1 addition & 1 deletion DataCollector/ProfilingProvider.php
Expand Up @@ -8,7 +8,7 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\DataCollector;
namespace Bazinga\GeocoderBundle\DataCollector;

use Geocoder\Collection;
use Geocoder\Exception\LogicException;
Expand Down
4 changes: 2 additions & 2 deletions DependencyInjection/BazingaGeocoderExtension.php
Expand Up @@ -8,9 +8,9 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\DependencyInjection;
namespace Bazinga\GeocoderBundle\DependencyInjection;

use Bazinga\Bundle\GeocoderBundle\ProviderFactory\ProviderFactoryInterface;
use Bazinga\GeocoderBundle\ProviderFactory\ProviderFactoryInterface;
use Geocoder\Provider\Cache\ProviderCache;
use Geocoder\Provider\Provider;
use Symfony\Component\Config\Definition\Processor;
Expand Down
2 changes: 1 addition & 1 deletion DependencyInjection/Compiler/AddProvidersPass.php
Expand Up @@ -8,7 +8,7 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\DependencyInjection\Compiler;
namespace Bazinga\GeocoderBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand Down
6 changes: 3 additions & 3 deletions DependencyInjection/Compiler/ProfilerPass.php
Expand Up @@ -8,10 +8,10 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\DependencyInjection\Compiler;
namespace Bazinga\GeocoderBundle\DependencyInjection\Compiler;

use Bazinga\Bundle\GeocoderBundle\DataCollector\GeocoderDataCollector;
use Bazinga\Bundle\GeocoderBundle\DataCollector\ProfilingProvider;
use Bazinga\GeocoderBundle\DataCollector\GeocoderDataCollector;
use Bazinga\GeocoderBundle\DataCollector\ProfilingProvider;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
Expand Down
2 changes: 1 addition & 1 deletion DependencyInjection/Configuration.php
Expand Up @@ -8,7 +8,7 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\DependencyInjection;
namespace Bazinga\GeocoderBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
Expand Down
4 changes: 2 additions & 2 deletions Doctrine/ORM/GeocoderListener.php
Expand Up @@ -8,9 +8,9 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\Doctrine\ORM;
namespace Bazinga\GeocoderBundle\Doctrine\ORM;

use Bazinga\Bundle\GeocoderBundle\Mapping\Driver\DriverInterface;
use Bazinga\GeocoderBundle\Mapping\Driver\DriverInterface;
use Doctrine\Common\EventSubscriber;
use Doctrine\ORM\Event\OnFlushEventArgs;
use Doctrine\ORM\Events;
Expand Down
2 changes: 1 addition & 1 deletion EventListener/FakeRequestListener.php
Expand Up @@ -8,7 +8,7 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\EventListener;
namespace Bazinga\GeocoderBundle\EventListener;

use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;
Expand Down
2 changes: 1 addition & 1 deletion Mapping/Annotations/Address.php
Expand Up @@ -8,7 +8,7 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\Mapping\Annotations;
namespace Bazinga\GeocoderBundle\Mapping\Annotations;

/**
* @author Markus Bachmann <markus.bachmann@bachi.biz>
Expand Down
2 changes: 1 addition & 1 deletion Mapping/Annotations/Geocodeable.php
Expand Up @@ -8,7 +8,7 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\Mapping\Annotations;
namespace Bazinga\GeocoderBundle\Mapping\Annotations;

/**
* @author Markus Bachmann <markus.bachmann@bachi.biz>
Expand Down
2 changes: 1 addition & 1 deletion Mapping/Annotations/Latitude.php
Expand Up @@ -8,7 +8,7 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\Mapping\Annotations;
namespace Bazinga\GeocoderBundle\Mapping\Annotations;

/**
* @author Markus Bachmann <markus.bachmann@bachi.biz>
Expand Down
2 changes: 1 addition & 1 deletion Mapping/Annotations/Longitude.php
Expand Up @@ -8,7 +8,7 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\Mapping\Annotations;
namespace Bazinga\GeocoderBundle\Mapping\Annotations;

/**
* @author Markus Bachmann <markus.bachmann@bachi.biz>
Expand Down
2 changes: 1 addition & 1 deletion Mapping/ClassMetadata.php
Expand Up @@ -8,7 +8,7 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\Mapping;
namespace Bazinga\GeocoderBundle\Mapping;

/**
* @author Markus Bachmann <markus.bachmann@bachi.biz>
Expand Down
12 changes: 6 additions & 6 deletions Mapping/Driver/AnnotationDriver.php
Expand Up @@ -8,11 +8,11 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\Mapping\Driver;
namespace Bazinga\GeocoderBundle\Mapping\Driver;

use Bazinga\Bundle\GeocoderBundle\Mapping\Annotations;
use Bazinga\Bundle\GeocoderBundle\Mapping\ClassMetadata;
use Bazinga\Bundle\GeocoderBundle\Mapping\Exception;
use Bazinga\GeocoderBundle\Mapping\Annotations;
use Bazinga\GeocoderBundle\Mapping\ClassMetadata;
use Bazinga\GeocoderBundle\Mapping\Exception;
use Doctrine\Common\Annotations\Reader;

/**
Expand All @@ -31,13 +31,13 @@ public function isGeocodeable($object)
{
$reflection = new \ReflectionObject($object);

return (bool) $this->reader->getClassAnnotation($reflection, 'Bazinga\\Bundle\\GeocoderBundle\\Mapping\\Annotations\\Geocodeable');
return (bool) $this->reader->getClassAnnotation($reflection, Annotations\Geocodeable::class);
}

public function loadMetadataFromObject($object)
{
$reflection = new \ReflectionObject($object);
if (!$annotation = $this->reader->getClassAnnotation($reflection, 'Bazinga\\Bundle\\GeocoderBundle\\Mapping\\Annotations\\Geocodeable')) {
if (!$annotation = $this->reader->getClassAnnotation($reflection, Annotations\Geocodeable::class)) {
throw new Exception\MappingException(sprintf(
'The class %s is not geocodeable', get_class($object)
));
Expand Down
2 changes: 1 addition & 1 deletion Mapping/Driver/DriverInterface.php
Expand Up @@ -8,7 +8,7 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\Mapping\Driver;
namespace Bazinga\GeocoderBundle\Mapping\Driver;

interface DriverInterface
{
Expand Down
2 changes: 1 addition & 1 deletion Mapping/Exception/MappingException.php
Expand Up @@ -8,7 +8,7 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\Mapping\Exception;
namespace Bazinga\GeocoderBundle\Mapping\Exception;

/**
* @author Markus Bachmann <markus.bachmann@bachi.biz>
Expand Down
2 changes: 1 addition & 1 deletion ProviderFactory/AbstractFactory.php
Expand Up @@ -8,7 +8,7 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\ProviderFactory;
namespace Bazinga\GeocoderBundle\ProviderFactory;

use Geocoder\Provider\Provider;
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
Expand Down
2 changes: 1 addition & 1 deletion ProviderFactory/ChainFactory.php
Expand Up @@ -8,7 +8,7 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\ProviderFactory;
namespace Bazinga\GeocoderBundle\ProviderFactory;

use Geocoder\Provider\Chain\Chain;
use Symfony\Component\OptionsResolver\OptionsResolver;
Expand Down
2 changes: 1 addition & 1 deletion ProviderFactory/GoogleMapsFactory.php
Expand Up @@ -8,7 +8,7 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\ProviderFactory;
namespace Bazinga\GeocoderBundle\ProviderFactory;

use Geocoder\Provider\GoogleMaps\GoogleMaps;
use Http\Client\HttpClient;
Expand Down
2 changes: 1 addition & 1 deletion ProviderFactory/ProviderFactoryInterface.php
Expand Up @@ -8,7 +8,7 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\ProviderFactory;
namespace Bazinga\GeocoderBundle\ProviderFactory;

use Geocoder\Provider\Provider;

Expand Down
4 changes: 2 additions & 2 deletions Resources/config/profiling.yml
@@ -1,6 +1,6 @@
services:
Bazinga\Bundle\GeocoderBundle\DataCollector\GeocoderDataCollector:
class: Bazinga\Bundle\GeocoderBundle\DataCollector\GeocoderDataCollector
Bazinga\GeocoderBundle\DataCollector\GeocoderDataCollector:
class: Bazinga\GeocoderBundle\DataCollector\GeocoderDataCollector
public: false
tags:
- { name: data_collector, template: "BazingaGeocoderBundle:Collector:geocoder", id: "geocoder" }
6 changes: 3 additions & 3 deletions Resources/config/services.yml
Expand Up @@ -4,15 +4,15 @@ services:
public: true
tags: ['bazinga_geocoder.dumper']

Bazinga\Bundle\GeocoderBundle\ProviderFactory\:
Bazinga\GeocoderBundle\ProviderFactory\:
resource: '../../ProviderFactory'
public: false

Geocoder\ProviderAggregator:
class: Geocoder\ProviderAggregator

Bazinga\Bundle\GeocoderBundle\EventListener\FakeRequestListener:
class: Bazinga\Bundle\GeocoderBundle\EventListener\FakeRequestListener
Bazinga\GeocoderBundle\EventListener\FakeRequestListener:
class: Bazinga\GeocoderBundle\EventListener\FakeRequestListener
arguments: ['127.0.0.1']
tags:
- { name: kernel.event_listener, event: "kernel.request", method: "onKernelRequest" }
Expand Down
4 changes: 2 additions & 2 deletions Tests/Command/GeocodeCommandTest.php
Expand Up @@ -8,9 +8,9 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\Tests\Command;
namespace Bazinga\GeocoderBundle\Tests\Command;

use Bazinga\Bundle\GeocoderBundle\Command\GeocodeCommand;
use Bazinga\GeocoderBundle\Command\GeocodeCommand;
use Geocoder\Model\Address;
use Geocoder\Model\AddressCollection;
use Geocoder\Model\Coordinates;
Expand Down
4 changes: 2 additions & 2 deletions Tests/DependencyInjection/ConfigurationTest.php
Expand Up @@ -8,9 +8,9 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\Tests\DependencyInjection;
namespace Bazinga\GeocoderBundle\Tests\DependencyInjection;

use Bazinga\Bundle\GeocoderBundle\DependencyInjection\Configuration;
use Bazinga\GeocoderBundle\DependencyInjection\Configuration;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Config\Definition\Processor;
use Symfony\Component\Yaml\Yaml;
Expand Down
Expand Up @@ -8,9 +8,9 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\Tests\EventListener;
namespace Bazinga\GeocoderBundle\Tests\EventListener;

use Bazinga\Bundle\GeocoderBundle\EventListener\FakeRequestListener;
use Bazinga\GeocoderBundle\EventListener\FakeRequestListener;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
Expand Down
2 changes: 1 addition & 1 deletion Tests/DependencyInjection/Fixtures/config.yml
Expand Up @@ -3,7 +3,7 @@ bazinga_geocoder:
ip: 33.33.33.11
providers:
bing_maps:
factory: Bazinga\Bundle\GeocoderBundle\ProviderFactory\GoogleMapsFactory
factory: Bazinga\GeocoderBundle\ProviderFactory\GoogleMapsFactory
options:
api_key: 123
locale: en_US
10 changes: 5 additions & 5 deletions Tests/Doctrine/ORM/GeocoderListenerTest.php
Expand Up @@ -8,10 +8,10 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\Tests\Doctrine\ORM;
namespace Bazinga\GeocoderBundle\Tests\Doctrine\ORM;

use Bazinga\Bundle\GeocoderBundle\Doctrine\ORM\GeocoderListener;
use Bazinga\Bundle\GeocoderBundle\Mapping\Driver\AnnotationDriver;
use Bazinga\GeocoderBundle\Doctrine\ORM\GeocoderListener;
use Bazinga\GeocoderBundle\Mapping\Driver\AnnotationDriver;
use Doctrine\Common\Annotations\AnnotationRegistry;
use Doctrine\Common\Annotations\SimpleAnnotationReader;
use Doctrine\DBAL\DriverManager;
Expand Down Expand Up @@ -61,7 +61,7 @@ protected function setUp()
$this->em = $this->_getTestEntityManager($conn);

$reader = new SimpleAnnotationReader();
$reader->addNamespace('Bazinga\Bundle\GeocoderBundle\Mapping\Annotations');
$reader->addNamespace('Bazinga\GeocoderBundle\Mapping\Annotations');
$reader->addNamespace('Doctrine\ORM\Mapping');

$driver = new AnnotationDriver($reader);
Expand All @@ -74,7 +74,7 @@ protected function setUp()

$sm = new SchemaTool($this->em);
$sm->createSchema([
$this->em->getClassMetadata('Bazinga\Bundle\GeocoderBundle\Tests\Doctrine\ORM\Dummy'),
$this->em->getClassMetadata('Bazinga\GeocoderBundle\Tests\Doctrine\ORM\Dummy'),
]);
}

Expand Down
4 changes: 2 additions & 2 deletions Tests/Functional/BundleInitializationTest.php
Expand Up @@ -10,9 +10,9 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\Tests\Functional;
namespace Bazinga\GeocoderBundle\Tests\Functional;

use Bazinga\Bundle\GeocoderBundle\BazingaGeocoderBundle;
use Bazinga\GeocoderBundle\BazingaGeocoderBundle;
use Geocoder\Provider\Cache\ProviderCache;
use Geocoder\Provider\GoogleMaps\GoogleMaps;
use Geocoder\Provider\Provider;
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/Helper/CacheHelper.php
Expand Up @@ -10,7 +10,7 @@
* @license MIT License
*/

namespace Bazinga\Bundle\GeocoderBundle\Tests\Functional\Helper;
namespace Bazinga\GeocoderBundle\Tests\Functional\Helper;

use Psr\SimpleCache\CacheInterface;

Expand Down
4 changes: 2 additions & 2 deletions Tests/Functional/config/cache.yml
Expand Up @@ -4,10 +4,10 @@ bazinga_geocoder:
enabled: false
providers:
acme:
factory: Bazinga\Bundle\GeocoderBundle\ProviderFactory\GoogleMapsFactory
factory: Bazinga\GeocoderBundle\ProviderFactory\GoogleMapsFactory
cache_lifetime: 10
cache: acme.cache

services:
acme.cache:
class: Bazinga\Bundle\GeocoderBundle\Tests\Functional\Helper\CacheHelper
class: Bazinga\GeocoderBundle\Tests\Functional\Helper\CacheHelper
2 changes: 1 addition & 1 deletion Tests/Functional/config/simple.yml
Expand Up @@ -4,4 +4,4 @@ bazinga_geocoder:
enabled: false
providers:
acme:
factory: Bazinga\Bundle\GeocoderBundle\ProviderFactory\GoogleMapsFactory
factory: Bazinga\GeocoderBundle\ProviderFactory\GoogleMapsFactory

0 comments on commit f12a689

Please sign in to comment.