Skip to content

Commit 77aece4

Browse files
committed
Modernize bundle structure
1 parent df29518 commit 77aece4

File tree

122 files changed

+52
-33
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+52
-33
lines changed

README.md

+4-7

composer.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@
6969
},
7070
"autoload": {
7171
"psr-4": {
72-
"Bazinga\\GeocoderBundle\\": ""
72+
"Bazinga\\GeocoderBundle\\": "src/"
73+
}
74+
},
75+
"autoload-dev": {
76+
"psr-4": {
77+
"Bazinga\\GeocoderBundle\\Tests\\": "tests"
7378
}
7479
},
7580
"scripts": {

Resources/config/profiling.yml config/profiling.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ services:
33
class: Bazinga\GeocoderBundle\DataCollector\GeocoderDataCollector
44
public: false
55
tags:
6-
- { name: data_collector, template: "@BazingaGeocoder/Collector/geocoder.html.twig", id: "geocoder" }
6+
- { name: data_collector, template: '@BazingaGeocoder/Collector/geocoder.html.twig', id: 'geocoder' }

Resources/config/services.yml config/services.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ services:
1212
Geocoder\Dumper\Wkt: ~
1313

1414
Bazinga\GeocoderBundle\ProviderFactory\:
15-
resource: '../../ProviderFactory'
15+
resource: '../src/ProviderFactory'
1616
public: false
1717
autowire: true
1818
autoconfigure: true

Resources/doc/cache.md doc/cache.md

+1-1

Resources/doc/custom-provider.md doc/custom-provider.md

+2-2

Resources/doc/doctrine.md doc/doctrine.md

+1-1

Resources/doc/plugins.md doc/plugins.md

+1-1
File renamed without changes.

Resources/doc/services.md doc/services.md

+2-2
File renamed without changes.

phpunit.xml.dist

+7-11
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,22 @@
88
convertWarningsToExceptions="true"
99
processIsolation="false"
1010
stopOnFailure="false"
11-
bootstrap="Tests/bootstrap.php"
12-
>
11+
bootstrap="tests/bootstrap.php"
12+
>
1313
<testsuites>
1414
<testsuite name="main">
15-
<directory>./Tests</directory>
16-
<exclude>./Tests/Doctrine</exclude>
15+
<directory>./tests</directory>
16+
<exclude>./tests/Doctrine</exclude>
1717
</testsuite>
18+
1819
<testsuite name="doctrine">
19-
<directory>./Tests/Doctrine</directory>
20+
<directory>./tests/Doctrine</directory>
2021
</testsuite>
2122
</testsuites>
2223

2324
<filter>
2425
<whitelist>
25-
<directory>.</directory>
26-
<exclude>
27-
<directory>./Resources</directory>
28-
<directory>./Tests</directory>
29-
<directory>./vendor</directory>
30-
</exclude>
26+
<directory>src</directory>
3127
</whitelist>
3228
</filter>
3329
</phpunit>

BazingaGeocoderBundle.php src/BazingaGeocoderBundle.php

+8
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,12 @@ public function build(ContainerBuilder $container)
3636
$container->addCompilerPass(new AddProvidersPass());
3737
$container->addCompilerPass(new FactoryValidatorPass());
3838
}
39+
40+
/**
41+
* {@inheritdoc}
42+
*/
43+
public function getPath(): string
44+
{
45+
return \dirname(__DIR__);
46+
}
3947
}
File renamed without changes.

DataCollector/GeocoderDataCollector.php src/DataCollector/GeocoderDataCollector.php

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
namespace Bazinga\GeocoderBundle\DataCollector;
1414

1515
use Bazinga\GeocoderBundle\Plugin\ProfilingPlugin;
16-
use Geocoder\Collection;
1716
use Geocoder\Query\Query;
1817
use Symfony\Component\HttpFoundation\Request;
1918
use Symfony\Component\HttpFoundation\Response;

DependencyInjection/BazingaGeocoderExtension.php src/DependencyInjection/BazingaGeocoderExtension.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function load(array $configs, ContainerBuilder $container)
5050
$configuration = $this->getConfiguration($configs, $container);
5151
$config = $processor->processConfiguration($configuration, $configs);
5252

53-
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
53+
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../../config'));
5454
$loader->load('services.yml');
5555

5656
if (true === $config['profiling']['enabled']) {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Tests/Functional/BundleInitializationTest.php tests/Functional/BundleInitializationTest.php

+11-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ protected static function createKernel(array $options = []): KernelInterface
5353

5454
public function testInitBundle(): void
5555
{
56-
$kernel = self::bootKernel();
56+
$kernel = self::bootKernel(['config' => static function (TestKernel $kernel) {
57+
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
58+
}]);
5759

5860
$container = method_exists(__CLASS__, 'getContainer') ? self::getContainer() : $kernel->getContainer();
5961

@@ -66,6 +68,7 @@ public function testInitBundle(): void
6668
public function testBundleWithOneProviderConfiguration(): void
6769
{
6870
$kernel = self::bootKernel(['config' => static function (TestKernel $kernel) {
71+
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
6972
$kernel->addTestConfig(__DIR__.'/config/simple.yml');
7073
}]);
7174

@@ -80,6 +83,7 @@ public function testBundleWithOneProviderConfiguration(): void
8083
public function testBundleWithCachedProvider(): void
8184
{
8285
$kernel = self::bootKernel(['config' => static function (TestKernel $kernel) {
86+
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
8387
$kernel->addTestConfig(__DIR__.'/config/cache.yml');
8488
}]);
8589

@@ -96,6 +100,7 @@ public function testBundleWithCachedProvider(): void
96100
public function testCacheLifetimeCanBeNull(): void
97101
{
98102
$kernel = self::bootKernel(['config' => static function (TestKernel $kernel) {
103+
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
99104
$kernel->addTestConfig(__DIR__.'/config/cache_without_lifetime.yml');
100105
}]);
101106

@@ -120,6 +125,7 @@ public function testCacheLifetimeCanBeNull(): void
120125
public function testBundleWithPluginsYml(): void
121126
{
122127
$kernel = self::bootKernel(['config' => static function (TestKernel $kernel) {
128+
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
123129
$kernel->addTestConfig(__DIR__.'/config/service_plugin.yml');
124130
}]);
125131

@@ -136,6 +142,7 @@ public function testBundleWithPluginsYml(): void
136142
public function testBundleWithPluginXml(): void
137143
{
138144
$kernel = self::bootKernel(['config' => static function (TestKernel $kernel) {
145+
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
139146
$kernel->addTestConfig(__DIR__.'/config/service_plugin.xml');
140147
}]);
141148

@@ -151,7 +158,9 @@ public function testBundleWithPluginXml(): void
151158

152159
public function testBundleHasRegisteredDumpers(): void
153160
{
154-
$kernel = self::bootKernel();
161+
$kernel = self::bootKernel(['config' => static function (TestKernel $kernel) {
162+
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
163+
}]);
155164

156165
$container = method_exists(__CLASS__, 'getContainer') ? self::getContainer() : $kernel->getContainer();
157166

Tests/Functional/ProviderFactoryTest.php tests/Functional/ProviderFactoryTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ protected static function createKernel(array $options = []): KernelInterface
7474
public function testProviderConfiguration($class, $serviceNames): void
7575
{
7676
$kernel = self::bootKernel(['config' => static function (TestKernel $kernel) use ($class) {
77+
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
7778
$kernel->addTestConfig(__DIR__.'/config/provider/'.strtolower(substr($class, strrpos($class, '\\') + 1)).'.yml');
7879
}]);
7980

File renamed without changes.

tests/Functional/config/framework.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
framework:
2+
http_method_override: false

Tests/Functional/config/provider/maxmindbinary.yml tests/Functional/config/provider/maxmindbinary.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ bazinga_geocoder:
55
acme:
66
factory: Bazinga\GeocoderBundle\ProviderFactory\MaxMindBinaryFactory
77
options:
8-
dat_file: '%kernel.project_dir%/Tests/DependencyInjection/Fixtures/maxmind.dat'
8+
dat_file: '%kernel.project_dir%/tests/DependencyInjection/Fixtures/maxmind.dat'

Tests/Functional/config/service_plugin.yml tests/Functional/config/service_plugin.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
framework:
2+
http_method_override: false
13

24
bazinga_geocoder:
35
profiling:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)