Skip to content

Commit ae94d0c

Browse files
committed
feat: allow doctrine/doctrine-bundle 3
1 parent f84142d commit ae94d0c

File tree

2 files changed

+35
-37
lines changed

2 files changed

+35
-37
lines changed

phpstan-baseline.php

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,197 +1,199 @@
1-
<?php declare(strict_types = 1);
1+
<?php
2+
3+
declare(strict_types=1);
24

35
$ignoreErrors = [];
46
$ignoreErrors[] = [
57
// identifier: argument.type
68
'message' => '#^Parameter \\#1 \\$name of method Geocoder\\\\ProviderAggregator\\:\\:using\\(\\) expects string, mixed given\\.$#',
79
'count' => 1,
8-
'path' => __DIR__ . '/src/Command/GeocodeCommand.php',
10+
'path' => __DIR__.'/src/Command/GeocodeCommand.php',
911
];
1012
$ignoreErrors[] = [
1113
// identifier: argument.type
1214
'message' => '#^Parameter \\#1 \\$string of function strtolower expects string, string\\|null given\\.$#',
1315
'count' => 1,
14-
'path' => __DIR__ . '/src/Command/GeocodeCommand.php',
16+
'path' => __DIR__.'/src/Command/GeocodeCommand.php',
1517
];
1618
$ignoreErrors[] = [
1719
// identifier: argument.type
1820
'message' => '#^Parameter \\#1 \\$text of static method Geocoder\\\\Query\\\\GeocodeQuery\\:\\:create\\(\\) expects string, mixed given\\.$#',
1921
'count' => 1,
20-
'path' => __DIR__ . '/src/Command/GeocodeCommand.php',
22+
'path' => __DIR__.'/src/Command/GeocodeCommand.php',
2123
];
2224
$ignoreErrors[] = [
2325
// identifier: argument.type
2426
'message' => '#^Parameter \\#3 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#',
2527
'count' => 1,
26-
'path' => __DIR__ . '/src/Command/GeocodeCommand.php',
28+
'path' => __DIR__.'/src/Command/GeocodeCommand.php',
2729
];
2830
$ignoreErrors[] = [
2931
// identifier: foreach.nonIterable
3032
'message' => '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#',
3133
'count' => 3,
32-
'path' => __DIR__ . '/src/DependencyInjection/BazingaGeocoderExtension.php',
34+
'path' => __DIR__.'/src/DependencyInjection/BazingaGeocoderExtension.php',
3335
];
3436
$ignoreErrors[] = [
3537
// identifier: offsetAccess.nonOffsetAccessible
3638
'message' => '#^Cannot access offset \'aliases\' on mixed\\.$#',
3739
'count' => 1,
38-
'path' => __DIR__ . '/src/DependencyInjection/BazingaGeocoderExtension.php',
40+
'path' => __DIR__.'/src/DependencyInjection/BazingaGeocoderExtension.php',
3941
];
4042
$ignoreErrors[] = [
4143
// identifier: offsetAccess.nonOffsetAccessible
4244
'message' => '#^Cannot access offset \'enabled\' on mixed\\.$#',
4345
'count' => 1,
44-
'path' => __DIR__ . '/src/DependencyInjection/BazingaGeocoderExtension.php',
46+
'path' => __DIR__.'/src/DependencyInjection/BazingaGeocoderExtension.php',
4547
];
4648
$ignoreErrors[] = [
4749
// identifier: offsetAccess.nonOffsetAccessible
4850
'message' => '#^Cannot access offset \'factory\' on mixed\\.$#',
4951
'count' => 5,
50-
'path' => __DIR__ . '/src/DependencyInjection/BazingaGeocoderExtension.php',
52+
'path' => __DIR__.'/src/DependencyInjection/BazingaGeocoderExtension.php',
5153
];
5254
$ignoreErrors[] = [
5355
// identifier: offsetAccess.nonOffsetAccessible
5456
'message' => '#^Cannot access offset \'id\' on mixed\\.$#',
5557
'count' => 1,
56-
'path' => __DIR__ . '/src/DependencyInjection/BazingaGeocoderExtension.php',
58+
'path' => __DIR__.'/src/DependencyInjection/BazingaGeocoderExtension.php',
5759
];
5860
$ignoreErrors[] = [
5961
// identifier: offsetAccess.nonOffsetAccessible
6062
'message' => '#^Cannot access offset \'options\' on mixed\\.$#',
6163
'count' => 4,
62-
'path' => __DIR__ . '/src/DependencyInjection/BazingaGeocoderExtension.php',
64+
'path' => __DIR__.'/src/DependencyInjection/BazingaGeocoderExtension.php',
6365
];
6466
$ignoreErrors[] = [
6567
// identifier: offsetAccess.nonOffsetAccessible
6668
'message' => '#^Cannot access offset \'reference\' on mixed\\.$#',
6769
'count' => 2,
68-
'path' => __DIR__ . '/src/DependencyInjection/BazingaGeocoderExtension.php',
70+
'path' => __DIR__.'/src/DependencyInjection/BazingaGeocoderExtension.php',
6971
];
7072
$ignoreErrors[] = [
7173
// identifier: staticMethod.nonObject
7274
'message' => '#^Cannot call static method validate\\(\\) on mixed\\.$#',
7375
'count' => 1,
74-
'path' => __DIR__ . '/src/DependencyInjection/BazingaGeocoderExtension.php',
76+
'path' => __DIR__.'/src/DependencyInjection/BazingaGeocoderExtension.php',
7577
];
7678
$ignoreErrors[] = [
7779
// identifier: cast.string
7880
'message' => '#^Cannot cast mixed to string\\.$#',
7981
'count' => 1,
80-
'path' => __DIR__ . '/src/DependencyInjection/BazingaGeocoderExtension.php',
82+
'path' => __DIR__.'/src/DependencyInjection/BazingaGeocoderExtension.php',
8183
];
8284
$ignoreErrors[] = [
8385
// identifier: argument.type
8486
'message' => '#^Parameter \\#1 \\$alias of method Symfony\\\\Component\\\\DependencyInjection\\\\ContainerBuilder\\:\\:setAlias\\(\\) expects string, mixed given\\.$#',
8587
'count' => 1,
86-
'path' => __DIR__ . '/src/DependencyInjection/BazingaGeocoderExtension.php',
88+
'path' => __DIR__.'/src/DependencyInjection/BazingaGeocoderExtension.php',
8789
];
8890
$ignoreErrors[] = [
8991
// identifier: argument.type
9092
'message' => '#^Parameter \\#1 \\$callback of function array_map expects \\(callable\\(mixed\\)\\: mixed\\)\\|null, Closure\\(string\\)\\: Symfony\\\\Component\\\\DependencyInjection\\\\Reference given\\.$#',
9193
'count' => 1,
92-
'path' => __DIR__ . '/src/DependencyInjection/BazingaGeocoderExtension.php',
94+
'path' => __DIR__.'/src/DependencyInjection/BazingaGeocoderExtension.php',
9395
];
9496
$ignoreErrors[] = [
9597
// identifier: argument.type
9698
'message' => '#^Parameter \\#1 \\$factoryServiceId of static method Bazinga\\\\GeocoderBundle\\\\DependencyInjection\\\\Compiler\\\\FactoryValidatorPass\\:\\:addFactoryServiceId\\(\\) expects string, mixed given\\.$#',
9799
'count' => 1,
98-
'path' => __DIR__ . '/src/DependencyInjection/BazingaGeocoderExtension.php',
100+
'path' => __DIR__.'/src/DependencyInjection/BazingaGeocoderExtension.php',
99101
];
100102
$ignoreErrors[] = [
101103
// identifier: argument.type
102104
'message' => '#^Parameter \\#1 \\$id of class Symfony\\\\Component\\\\DependencyInjection\\\\Reference constructor expects string, mixed given\\.$#',
103105
'count' => 1,
104-
'path' => __DIR__ . '/src/DependencyInjection/BazingaGeocoderExtension.php',
106+
'path' => __DIR__.'/src/DependencyInjection/BazingaGeocoderExtension.php',
105107
];
106108
$ignoreErrors[] = [
107109
// identifier: argument.type
108110
'message' => '#^Parameter \\#1 \\$id of method Symfony\\\\Component\\\\DependencyInjection\\\\ContainerBuilder\\:\\:getDefinition\\(\\) expects string, mixed given\\.$#',
109111
'count' => 1,
110-
'path' => __DIR__ . '/src/DependencyInjection/BazingaGeocoderExtension.php',
112+
'path' => __DIR__.'/src/DependencyInjection/BazingaGeocoderExtension.php',
111113
];
112114
$ignoreErrors[] = [
113115
// identifier: argument.type
114116
'message' => '#^Parameter \\#1 \\$object_or_class of function class_implements expects object\\|string, mixed given\\.$#',
115117
'count' => 1,
116-
'path' => __DIR__ . '/src/DependencyInjection/BazingaGeocoderExtension.php',
118+
'path' => __DIR__.'/src/DependencyInjection/BazingaGeocoderExtension.php',
117119
];
118120
$ignoreErrors[] = [
119121
// identifier: argument.type
120122
'message' => '#^Parameter \\#1 \\$options of method Bazinga\\\\GeocoderBundle\\\\DependencyInjection\\\\BazingaGeocoderExtension\\:\\:findReferences\\(\\) expects array\\<int\\|string, mixed\\>, mixed given\\.$#',
121123
'count' => 2,
122-
'path' => __DIR__ . '/src/DependencyInjection/BazingaGeocoderExtension.php',
124+
'path' => __DIR__.'/src/DependencyInjection/BazingaGeocoderExtension.php',
123125
];
124126
$ignoreErrors[] = [
125127
// identifier: argument.type
126128
'message' => '#^Parameter \\#1 \\$string of function ltrim expects string, mixed given\\.$#',
127129
'count' => 1,
128-
'path' => __DIR__ . '/src/DependencyInjection/BazingaGeocoderExtension.php',
130+
'path' => __DIR__.'/src/DependencyInjection/BazingaGeocoderExtension.php',
129131
];
130132
$ignoreErrors[] = [
131133
// identifier: argument.type
132134
'message' => '#^Parameter \\#2 \\$config of method Bazinga\\\\GeocoderBundle\\\\DependencyInjection\\\\BazingaGeocoderExtension\\:\\:configureProviderPlugins\\(\\) expects array\\<int\\|string, mixed\\>, mixed given\\.$#',
133135
'count' => 1,
134-
'path' => __DIR__ . '/src/DependencyInjection/BazingaGeocoderExtension.php',
136+
'path' => __DIR__.'/src/DependencyInjection/BazingaGeocoderExtension.php',
135137
];
136138
$ignoreErrors[] = [
137139
// identifier: argument.type
138140
'message' => '#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#',
139141
'count' => 1,
140-
'path' => __DIR__ . '/src/DependencyInjection/BazingaGeocoderExtension.php',
142+
'path' => __DIR__.'/src/DependencyInjection/BazingaGeocoderExtension.php',
141143
];
142144
$ignoreErrors[] = [
143145
// identifier: encapsedStringPart.nonString
144146
'message' => '#^Part \\$providerName \\(mixed\\) of encapsed string cannot be cast to string\\.$#',
145147
'count' => 1,
146-
'path' => __DIR__ . '/src/DependencyInjection/BazingaGeocoderExtension.php',
148+
'path' => __DIR__.'/src/DependencyInjection/BazingaGeocoderExtension.php',
147149
];
148150
$ignoreErrors[] = [
149151
// identifier: method.nonObject
150152
'message' => '#^Cannot call method getLatitude\\(\\) on Geocoder\\\\Model\\\\Coordinates\\|null\\.$#',
151153
'count' => 1,
152-
'path' => __DIR__ . '/src/Doctrine/ORM/GeocoderListener.php',
154+
'path' => __DIR__.'/src/Doctrine/ORM/GeocoderListener.php',
153155
];
154156
$ignoreErrors[] = [
155157
// identifier: method.nonObject
156158
'message' => '#^Cannot call method getLongitude\\(\\) on Geocoder\\\\Model\\\\Coordinates\\|null\\.$#',
157159
'count' => 1,
158-
'path' => __DIR__ . '/src/Doctrine/ORM/GeocoderListener.php',
160+
'path' => __DIR__.'/src/Doctrine/ORM/GeocoderListener.php',
159161
];
160162
$ignoreErrors[] = [
161163
// identifier: argument.type
162164
'message' => '#^Parameter \\#1 \\$text of method Geocoder\\\\Query\\\\GeocodeQuery\\:\\:withText\\(\\) expects string, string\\|null given\\.$#',
163165
'count' => 1,
164-
'path' => __DIR__ . '/src/Plugin/FakeIpPlugin.php',
166+
'path' => __DIR__.'/src/Plugin/FakeIpPlugin.php',
165167
];
166168
$ignoreErrors[] = [
167169
// identifier: argument.type
168170
'message' => '#^Parameter \\#2 \\$replace of function str_replace expects array\\|string, string\\|null given\\.$#',
169171
'count' => 1,
170-
'path' => __DIR__ . '/src/Plugin/FakeIpPlugin.php',
172+
'path' => __DIR__.'/src/Plugin/FakeIpPlugin.php',
171173
];
172174
$ignoreErrors[] = [
173175
// identifier: argument.type
174176
'message' => '#^Parameter \\#1 \\$accountId of class GeoIp2\\\\WebService\\\\Client constructor expects int, int\\|null given\\.$#',
175177
'count' => 1,
176-
'path' => __DIR__ . '/src/ProviderFactory/GeoIP2Factory.php',
178+
'path' => __DIR__.'/src/ProviderFactory/GeoIP2Factory.php',
177179
];
178180
$ignoreErrors[] = [
179181
// identifier: argument.type
180182
'message' => '#^Parameter \\#1 \\$filename of class GeoIp2\\\\Database\\\\Reader constructor expects string, string\\|null given\\.$#',
181183
'count' => 1,
182-
'path' => __DIR__ . '/src/ProviderFactory/GeoIP2Factory.php',
184+
'path' => __DIR__.'/src/ProviderFactory/GeoIP2Factory.php',
183185
];
184186
$ignoreErrors[] = [
185187
// identifier: argument.type
186188
'message' => '#^Parameter \\#1 \\$geoIpProvider of class Geocoder\\\\Provider\\\\GeoIP2\\\\GeoIP2Adapter constructor expects GeoIp2\\\\ProviderInterface, GeoIp2\\\\ProviderInterface\\|null given\\.$#',
187189
'count' => 1,
188-
'path' => __DIR__ . '/src/ProviderFactory/GeoIP2Factory.php',
190+
'path' => __DIR__.'/src/ProviderFactory/GeoIP2Factory.php',
189191
];
190192
$ignoreErrors[] = [
191193
// identifier: argument.type
192194
'message' => '#^Parameter \\#2 \\$licenseKey of class GeoIp2\\\\WebService\\\\Client constructor expects string, string\\|null given\\.$#',
193195
'count' => 1,
194-
'path' => __DIR__ . '/src/ProviderFactory/GeoIP2Factory.php',
196+
'path' => __DIR__.'/src/ProviderFactory/GeoIP2Factory.php',
195197
];
196198

197199
return ['parameters' => ['ignoreErrors' => $ignoreErrors]];

tests/Functional/GeocoderListenerTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use Bazinga\GeocoderBundle\Tests\Functional\Fixtures\Entity\DummyWithStringableGetter;
2121
use Bazinga\GeocoderBundle\Tests\Functional\Fixtures\Entity\StringableAddress;
2222
use Composer\InstalledVersions;
23-
use Doctrine\Bundle\DoctrineBundle\ConnectionFactory;
2423
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
2524
use Doctrine\ORM\Tools\SchemaTool;
2625
use Nyholm\BundleTest\TestKernel;
@@ -65,7 +64,6 @@ public function process(ContainerBuilder $container): void
6564
->setPublic(true);
6665
}
6766
});
68-
6967
$kernel->addTestConfig(static function (ContainerBuilder $container) {
7068
$orm = [];
7169
// doctrine-bundle
@@ -75,11 +73,9 @@ public function process(ContainerBuilder $container): void
7573
$orm['auto_generate_proxy_classes'] = true;
7674
$orm['controller_resolver']['auto_mapping'] = true;
7775
}
78-
7976
if (version_compare($doctrineBundleVersion, '2.8.0', '>=') && version_compare($doctrineBundleVersion, '3.0.0', '<')) {
8077
$orm['enable_lazy_ghost_objects'] = true;
8178
}
82-
8379
if (\PHP_VERSION_ID >= 80400 && version_compare($doctrineBundleVersion, '2.15.0', '>=') && version_compare($doctrineBundleVersion, '3.1.0', '<')) {
8480
$orm['enable_native_lazy_objects'] = true;
8581
}

0 commit comments

Comments
 (0)