From 58097824cb7206f0373cfea22f61396a83914655 Mon Sep 17 00:00:00 2001 From: Andrea Sprega Date: Wed, 19 May 2021 23:20:17 +0200 Subject: [PATCH] Move to slope-it organization, change namespace to SlopeIt\BreadcrumbBundle --- AndreaSpregaBreadcrumbBundle.php | 17 ---------- LICENSE | 8 ++++- README.md | 31 +++++++++-------- Resources/config/services.yml | 33 ------------------- composer.json | 24 +++++++++----- phpunit.xml.dist | 31 +++++------------ phpunit.xml.dist.bak | 27 +++++++++++++++ {Annotation => src/Annotation}/Breadcrumb.php | 2 +- .../DependencyInjection}/Configuration.php | 4 +-- .../SlopeItBreadcrumbExtension.php | 11 +++---- .../EventListener}/BreadcrumbListener.php | 6 ++-- {Model => src/Model}/BreadcrumbItem.php | 2 +- .../Model}/ProcessedBreadcrumbItem.php | 2 +- src/Resources/config/services.yml | 33 +++++++++++++++++++ .../Resources}/views/breadcrumb.html.twig | 0 .../Service}/BreadcrumbBuilder.php | 4 +-- .../Service}/BreadcrumbItemFactory.php | 4 +-- .../Service}/BreadcrumbItemProcessor.php | 6 ++-- src/SlopeItBreadcrumbBundle.php | 17 ++++++++++ {Twig => src/Twig}/BreadcrumbExtension.php | 10 +++--- .../Annotation/BreadcrumbTest.php | 6 ++-- .../DependencyInjection/ConfigurationTest.php | 10 +++--- .../EventListener/BreadcrumbListenerTest.php | 8 ++--- {Tests => tests}/Model/BreadcrumbItemTest.php | 6 ++-- .../Model/ProcessedBreadcrumbItemTest.php | 6 ++-- .../Service/BreadcrumbBuilderTest.php | 10 +++--- .../Service/BreadcrumbItemFactoryTest.php | 8 ++--- .../Service/BreadcrumbItemProcessorTest.php | 8 ++--- 28 files changed, 179 insertions(+), 155 deletions(-) delete mode 100644 AndreaSpregaBreadcrumbBundle.php delete mode 100644 Resources/config/services.yml create mode 100644 phpunit.xml.dist.bak rename {Annotation => src/Annotation}/Breadcrumb.php (96%) rename {DependencyInjection => src/DependencyInjection}/Configuration.php (79%) rename DependencyInjection/AndreaSpregaBreadcrumbExtension.php => src/DependencyInjection/SlopeItBreadcrumbExtension.php (70%) rename {EventListener => src/EventListener}/BreadcrumbListener.php (90%) rename {Model => src/Model}/BreadcrumbItem.php (95%) rename {Model => src/Model}/ProcessedBreadcrumbItem.php (92%) create mode 100644 src/Resources/config/services.yml rename {Resources => src/Resources}/views/breadcrumb.html.twig (100%) rename {Service => src/Service}/BreadcrumbBuilder.php (90%) rename {Service => src/Service}/BreadcrumbItemFactory.php (76%) rename {Service => src/Service}/BreadcrumbItemProcessor.php (94%) create mode 100644 src/SlopeItBreadcrumbBundle.php rename {Twig => src/Twig}/BreadcrumbExtension.php (85%) rename {Tests => tests}/Annotation/BreadcrumbTest.php (90%) rename {Tests => tests}/DependencyInjection/ConfigurationTest.php (63%) rename {Tests => tests}/EventListener/BreadcrumbListenerTest.php (79%) rename {Tests => tests}/Model/BreadcrumbItemTest.php (78%) rename {Tests => tests}/Model/ProcessedBreadcrumbItemTest.php (71%) rename {Tests => tests}/Service/BreadcrumbBuilderTest.php (80%) rename {Tests => tests}/Service/BreadcrumbItemFactoryTest.php (60%) rename {Tests => tests}/Service/BreadcrumbItemProcessorTest.php (93%) diff --git a/AndreaSpregaBreadcrumbBundle.php b/AndreaSpregaBreadcrumbBundle.php deleted file mode 100644 index 8ee3ff4..0000000 --- a/AndreaSpregaBreadcrumbBundle.php +++ /dev/null @@ -1,17 +0,0 @@ -get('asprega.breadcrumb.builder'); + $builder = $this->get('slope_it.breadcrumb.builder'); $builder->addItem('home', 'home_route'); $builder->addItem('$entity.property', 'entity_route'); $builder->addItem('cool_stuff'); @@ -77,7 +76,7 @@ public function coolStuffAction() ``` php - - - + - - ./Tests + + tests - - - - . - - ./Resources - ./Tests - ./vendor - - - - diff --git a/phpunit.xml.dist.bak b/phpunit.xml.dist.bak new file mode 100644 index 0000000..4db632f --- /dev/null +++ b/phpunit.xml.dist.bak @@ -0,0 +1,27 @@ + + + + + + + ./Tests + + + + + + . + + ./Resources + ./Tests + ./vendor + + + + + diff --git a/Annotation/Breadcrumb.php b/src/Annotation/Breadcrumb.php similarity index 96% rename from Annotation/Breadcrumb.php rename to src/Annotation/Breadcrumb.php index e162ac3..e482e40 100644 --- a/Annotation/Breadcrumb.php +++ b/src/Annotation/Breadcrumb.php @@ -1,6 +1,6 @@ getRootNode() ->children() ->scalarNode('template')->defaultValue('@AndreaSpregaBreadcrumb/breadcrumb.html.twig')->end() diff --git a/DependencyInjection/AndreaSpregaBreadcrumbExtension.php b/src/DependencyInjection/SlopeItBreadcrumbExtension.php similarity index 70% rename from DependencyInjection/AndreaSpregaBreadcrumbExtension.php rename to src/DependencyInjection/SlopeItBreadcrumbExtension.php index 7921720..961ee30 100644 --- a/DependencyInjection/AndreaSpregaBreadcrumbExtension.php +++ b/src/DependencyInjection/SlopeItBreadcrumbExtension.php @@ -1,23 +1,20 @@ processConfiguration($configuration, $configs); - $container->setParameter('asprega_breadcrumb.template', $config['template']); + $container->setParameter('slope_it_breadcrumb.template', $config['template']); } } diff --git a/EventListener/BreadcrumbListener.php b/src/EventListener/BreadcrumbListener.php similarity index 90% rename from EventListener/BreadcrumbListener.php rename to src/EventListener/BreadcrumbListener.php index b09c90d..d0a29fc 100644 --- a/EventListener/BreadcrumbListener.php +++ b/src/EventListener/BreadcrumbListener.php @@ -1,9 +1,9 @@ [ 'html' ], @@ -60,7 +60,7 @@ public function getFunctions() */ public function getName() { - return 'asprega_breadcrumb'; + return 'slope_it_breadcrumb'; } /** diff --git a/Tests/Annotation/BreadcrumbTest.php b/tests/Annotation/BreadcrumbTest.php similarity index 90% rename from Tests/Annotation/BreadcrumbTest.php rename to tests/Annotation/BreadcrumbTest.php index a7aa7e2..f4f538b 100644 --- a/Tests/Annotation/BreadcrumbTest.php +++ b/tests/Annotation/BreadcrumbTest.php @@ -1,13 +1,13 @@ [ + 'slope_it_breadcrumb' => [ 'template' => 'aTemplate.html.twig' ] ]; @@ -30,6 +30,6 @@ public function test_load_overrideTemplate() $processor = new Processor(); $processedConfig = $processor->processConfiguration(new Configuration(), $config); - $this->assertEquals([ 'template' => 'aTemplate.html.twig' ], $processedConfig); + $this->assertEquals(['template' => 'aTemplate.html.twig'], $processedConfig); } } diff --git a/Tests/EventListener/BreadcrumbListenerTest.php b/tests/EventListener/BreadcrumbListenerTest.php similarity index 79% rename from Tests/EventListener/BreadcrumbListenerTest.php rename to tests/EventListener/BreadcrumbListenerTest.php index 53a4d40..fd1d8be 100644 --- a/Tests/EventListener/BreadcrumbListenerTest.php +++ b/tests/EventListener/BreadcrumbListenerTest.php @@ -1,9 +1,9 @@