From be568ee174cc381d533aaa0139366e3473b38d1a Mon Sep 17 00:00:00 2001 From: Piotr Polak Date: Thu, 25 Oct 2018 18:00:05 +0200 Subject: [PATCH] Normalized package name --- README.md | 16 ++++++++-------- composer.json | 2 +- .../Compiler/RouteResolverCompilerPass.php | 2 +- ...=> PiotrPolakConditionalRoutingExtension.php} | 4 ++-- src/Model/AbstractControllerRouteResolver.php | 4 ++-- src/Model/AbstractRouteResolver.php | 4 ++-- src/Model/AbstractXmlRouteResolver.php | 4 ++-- src/Model/AbstractYamlRouteResolver.php | 4 ++-- src/Model/RouteResolverInterface.php | 4 ++-- .../AbstractBundleRoutingDefinition.php | 2 +- .../BundleRoutingDefinitionInterface.php | 2 +- .../ControllerBundleRoutingDefinition.php | 2 +- .../XmlBundleRoutingDefinition.php | 2 +- .../YamlBundleRoutingDefinition.php | 2 +- ...hp => PiotrPolakConditionalRoutingBundle.php} | 6 +++--- src/Resources/config/services.yml | 4 ++-- src/Router/ConditionalRouter.php | 2 +- src/Router/ConditionalRoutesLoader.php | 10 +++++----- .../BaseConditionalRoutingBundleTestCase.php | 2 +- .../Compiler/RouteResolverCompilerPassTest.php | 6 +++--- ...PiotrpolakConditionalRoutingExtensionTest.php | 10 +++++----- .../AbstractControllerRouteResolverTest.php | 6 +++--- src/Tests/Model/AbstractRouteResolverTest.php | 6 +++--- src/Tests/Model/AbstractXmlRouteResolverTest.php | 6 +++--- .../Model/AbstractYamlRouteResolverTest.php | 6 +++--- .../ControllerBundleRoutingDefinitionTest.php | 4 ++-- .../XmlBundleRoutingDefinitionTest.php | 4 ++-- .../YamlBundleRoutingDefinitionTest.php | 4 ++-- .../PiotrpolakConditionalRoutingBundleTest.php | 10 +++++----- src/Tests/Router/ConditionalRouterTest.php | 6 +++--- src/Tests/Router/ConditionalRoutesLoaderTest.php | 14 +++++++------- 31 files changed, 80 insertions(+), 80 deletions(-) rename src/DependencyInjection/{PiotrpolakConditionalRoutingExtension.php => PiotrPolakConditionalRoutingExtension.php} (82%) rename src/{PiotrpolakConditionalRoutingBundle.php => PiotrPolakConditionalRoutingBundle.php} (66%) diff --git a/README.md b/README.md index d1c7ce9..76eda1f 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,13 @@ Solves the problem of redirecting (overwriting) Symfony application routes from composer require piotrpolak/conditional-routing-bundle ``` -### Enable `PiotrpolakConditionalRoutingBundle` in the application kernel +### Enable `PiotrPolakConditionalRoutingBundle` in the application kernel ```php // in AppKernel::registerBundles() $bundles = array( // ... - new Piotrpolak\ConditionalRoutingBundle\PiotrpolakConditionalRoutingBundle(), + new PiotrPolak\ConditionalRoutingBundle\PiotrPolakConditionalRoutingBundle(), // ... ); ``` @@ -42,7 +42,7 @@ Including `routing.yml` will enable the `ConditionalRouterLoader`. ```yaml # in app/config/routing.yml, without those lines ConditionalRouterLoader will not be enabled conditional_routing: - resource: "@PiotrpolakConditionalRoutingBundle/Resources/config/routing.yml" + resource: "@PiotrPolakConditionalRoutingBundle/Resources/config/routing.yml" type: yaml ``` @@ -73,7 +73,7 @@ must first be enabled in `AppKernel.php`. namespace MyApp\Router; -use Piotrpolak\ConditionalRoutingBundle\Model\AbstractYamlRouteResolver; +use PiotrPolak\ConditionalRoutingBundle\Model\AbstractYamlRouteResolver; class TimeCampaignRouteResolver extends AbstractYamlRouteResolver { @@ -116,7 +116,7 @@ Reading the current bundle name from the database. namespace MyApp\Router; use Doctrine\ORM\EntityManagerInterface; -use Piotrpolak\ConditionalRoutingBundle\Model\AbstractYamlRouteResolver; +use PiotrPolak\ConditionalRoutingBundle\Model\AbstractYamlRouteResolver; class DatabaseCampaignRouteResolver extends AbstractYamlRouteResolver { @@ -178,9 +178,9 @@ YAML and XML types. namespace MyApp\Router; -use Piotrpolak\ConditionalRoutingBundle\Model\RouteResolverInterface; -use Piotrpolak\ConditionalRoutingBundle\Model\RoutingDefinition\XmlBundleRoutingDefinition; -use Piotrpolak\ConditionalRoutingBundle\Model\RoutingDefinition\YamlBundleRoutingDefinition; +use PiotrPolak\ConditionalRoutingBundle\Model\RouteResolverInterface; +use PiotrPolak\ConditionalRoutingBundle\Model\RoutingDefinition\XmlBundleRoutingDefinition; +use PiotrPolak\ConditionalRoutingBundle\Model\RoutingDefinition\YamlBundleRoutingDefinition; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface; diff --git a/composer.json b/composer.json index 3384fdd..b095d0e 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "license": "MIT", "autoload": { "psr-4": { - "Piotrpolak\\ConditionalRoutingBundle\\": "src/" + "PiotrPolak\\ConditionalRoutingBundle\\": "src/" }, "exclude-from-classmap": [ "/src/Tests/" diff --git a/src/DependencyInjection/Compiler/RouteResolverCompilerPass.php b/src/DependencyInjection/Compiler/RouteResolverCompilerPass.php index d51ae5f..10349bc 100644 --- a/src/DependencyInjection/Compiler/RouteResolverCompilerPass.php +++ b/src/DependencyInjection/Compiler/RouteResolverCompilerPass.php @@ -1,6 +1,6 @@ */ -class PiotrpolakConditionalRoutingExtension extends Extension +class PiotrPolakConditionalRoutingExtension extends Extension { /** * {@inheritdoc} diff --git a/src/Model/AbstractControllerRouteResolver.php b/src/Model/AbstractControllerRouteResolver.php index a8e44e5..2f3f355 100644 --- a/src/Model/AbstractControllerRouteResolver.php +++ b/src/Model/AbstractControllerRouteResolver.php @@ -1,8 +1,8 @@ load(array(), $this->getContainerBuilderMock()); } } diff --git a/src/Tests/Model/AbstractControllerRouteResolverTest.php b/src/Tests/Model/AbstractControllerRouteResolverTest.php index 8846212..6fff1da 100644 --- a/src/Tests/Model/AbstractControllerRouteResolverTest.php +++ b/src/Tests/Model/AbstractControllerRouteResolverTest.php @@ -1,8 +1,8 @@ assertGreaterThan(0, count($definitions)); foreach ($definitions as $definition) { - $this->assertInstanceOf('\Piotrpolak\ConditionalRoutingBundle\Model\RoutingDefinition\ControllerBundleRoutingDefinition', $definition); + $this->assertInstanceOf('\PiotrPolak\ConditionalRoutingBundle\Model\RoutingDefinition\ControllerBundleRoutingDefinition', $definition); } } } diff --git a/src/Tests/Model/AbstractRouteResolverTest.php b/src/Tests/Model/AbstractRouteResolverTest.php index 8a06aab..0055fd8 100644 --- a/src/Tests/Model/AbstractRouteResolverTest.php +++ b/src/Tests/Model/AbstractRouteResolverTest.php @@ -1,9 +1,9 @@ assertGreaterThan(0, count($definitions)); foreach ($definitions as $definition) { - $this->assertInstanceOf('\Piotrpolak\ConditionalRoutingBundle\Model\RoutingDefinition\XmlBundleRoutingDefinition', $definition); + $this->assertInstanceOf('\PiotrPolak\ConditionalRoutingBundle\Model\RoutingDefinition\XmlBundleRoutingDefinition', $definition); } } } diff --git a/src/Tests/Model/AbstractYamlRouteResolverTest.php b/src/Tests/Model/AbstractYamlRouteResolverTest.php index 63ec72e..c68a081 100644 --- a/src/Tests/Model/AbstractYamlRouteResolverTest.php +++ b/src/Tests/Model/AbstractYamlRouteResolverTest.php @@ -1,8 +1,8 @@ assertGreaterThan(0, count($definitions)); foreach ($definitions as $definition) { - $this->assertInstanceOf('\Piotrpolak\ConditionalRoutingBundle\Model\RoutingDefinition\YamlBundleRoutingDefinition', $definition); + $this->assertInstanceOf('\PiotrPolak\ConditionalRoutingBundle\Model\RoutingDefinition\YamlBundleRoutingDefinition', $definition); } } } diff --git a/src/Tests/Model/RoutingDefinition/ControllerBundleRoutingDefinitionTest.php b/src/Tests/Model/RoutingDefinition/ControllerBundleRoutingDefinitionTest.php index 09ffad2..e9ae2d8 100644 --- a/src/Tests/Model/RoutingDefinition/ControllerBundleRoutingDefinitionTest.php +++ b/src/Tests/Model/RoutingDefinition/ControllerBundleRoutingDefinitionTest.php @@ -1,8 +1,8 @@ getContainerBuilderMock(); $containerBuilder->expects($this->once())->method('addCompilerPass')->with(new RouteResolverCompilerPass()); - $bundle = new PiotrpolakConditionalRoutingBundle(); + $bundle = new PiotrPolakConditionalRoutingBundle(); $bundle->build($containerBuilder); } } diff --git a/src/Tests/Router/ConditionalRouterTest.php b/src/Tests/Router/ConditionalRouterTest.php index a096add..f5d0a83 100644 --- a/src/Tests/Router/ConditionalRouterTest.php +++ b/src/Tests/Router/ConditionalRouterTest.php @@ -1,8 +1,8 @@ getMock('\Piotrpolak\ConditionalRoutingBundle\Router\ConditionalRoutesLoader'); + $loader = $this->getMock('\PiotrPolak\ConditionalRoutingBundle\Router\ConditionalRoutesLoader'); $loader->expects($this->any())->method('getResolverKeys')->willReturn($suffix); $containerInterface = $this->getMock('\Symfony\Component\DependencyInjection\ContainerInterface'); $containerInterface->expects($this->any())->method('has')->with('conditional_router.routing_loader')->willReturn(true); diff --git a/src/Tests/Router/ConditionalRoutesLoaderTest.php b/src/Tests/Router/ConditionalRoutesLoaderTest.php index aab3560..848c31a 100644 --- a/src/Tests/Router/ConditionalRoutesLoaderTest.php +++ b/src/Tests/Router/ConditionalRoutesLoaderTest.php @@ -1,8 +1,8 @@ getMock('\Piotrpolak\ConditionalRoutingBundle\Model\RoutingDefinition\BundleRoutingDefinitionInterface'); + $definition = $this->getMock('\PiotrPolak\ConditionalRoutingBundle\Model\RoutingDefinition\BundleRoutingDefinitionInterface'); $definition->expects($this->any())->method('getBundleName')->willReturn('SampleBundle'); $definition->expects($this->any())->method('getResource')->willReturn('@SampleBundle/Resources/config/routing.yml'); $definition->expects($this->any())->method('getType')->willReturn('yaml'); - $routeResolver = $this->getMock('\Piotrpolak\ConditionalRoutingBundle\Model\RouteResolverInterface'); + $routeResolver = $this->getMock('\PiotrPolak\ConditionalRoutingBundle\Model\RouteResolverInterface'); $routeResolver->expects($this->atLeastOnce()) ->method('resolveConditionalRoutingDefinitions') ->willReturn(array($definition)); @@ -57,17 +57,17 @@ public function testOneBundle() public function testTwoBundles() { - $definition = $this->getMock('\Piotrpolak\ConditionalRoutingBundle\Model\RoutingDefinition\BundleRoutingDefinitionInterface'); + $definition = $this->getMock('\PiotrPolak\ConditionalRoutingBundle\Model\RoutingDefinition\BundleRoutingDefinitionInterface'); $definition->expects($this->any())->method('getBundleName')->willReturn('SampleBundle'); $definition->expects($this->any())->method('getResource')->willReturn('@SampleBundle/Resources/config/routing.yml'); $definition->expects($this->any())->method('getType')->willReturn('yaml'); - $definition2 = $this->getMock('\Piotrpolak\ConditionalRoutingBundle\Model\RoutingDefinition\BundleRoutingDefinitionInterface'); + $definition2 = $this->getMock('\PiotrPolak\ConditionalRoutingBundle\Model\RoutingDefinition\BundleRoutingDefinitionInterface'); $definition2->expects($this->any())->method('getBundleName')->willReturn('AAASecondSampleBundle'); $definition2->expects($this->any())->method('getResource')->willReturn('@SampleBundle/Resources/config/routing.yml'); $definition2->expects($this->any())->method('getType')->willReturn('yaml'); - $routeResolver = $this->getMock('\Piotrpolak\ConditionalRoutingBundle\Model\RouteResolverInterface'); + $routeResolver = $this->getMock('\PiotrPolak\ConditionalRoutingBundle\Model\RouteResolverInterface'); $routeResolver->expects($this->atLeastOnce()) ->method('resolveConditionalRoutingDefinitions') ->willReturn(array($definition, $definition2));