Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"willdurand/geocoder": "^4.6|^5.0"
},
"require-dev": {
"doctrine/doctrine-bundle": "^2.3",
"doctrine/doctrine-bundle": "^2.18 || ^3.0",
"doctrine/orm": "^2.20 || ^3.0",
"fakerphp/faker": "^1.20",
"friendsofphp/php-cs-fixer": "^3.13",
Expand Down
4 changes: 1 addition & 3 deletions src/DependencyInjection/BazingaGeocoderExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ class BazingaGeocoderExtension extends Extension
{
/**
* @param array<mixed, mixed> $configs
*
* @return void
*/
public function load(array $configs, ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container): void
{
$processor = new Processor();
$configuration = $this->getConfiguration($configs, $container);
Expand Down
4 changes: 1 addition & 3 deletions src/DependencyInjection/Compiler/AddProvidersPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ class AddProvidersPass implements CompilerPassInterface
/**
* Get all providers based on their tag (`bazinga_geocoder.provider`) and
* register them.
*
* @return void
*/
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
if (!$container->hasDefinition(ProviderAggregator::class)) {
return;
Expand Down
5 changes: 1 addition & 4 deletions src/DependencyInjection/Compiler/FactoryValidatorPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ class FactoryValidatorPass implements CompilerPassInterface
*/
private static $factoryServiceIds = [];

/**
* @return void
*/
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
foreach (self::$factoryServiceIds as $id) {
if (!$container->hasAlias($id) && !$container->hasDefinition($id)) {
Expand Down
5 changes: 1 addition & 4 deletions src/DependencyInjection/Compiler/ProfilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
*/
class ProfilerPass implements CompilerPassInterface
{
/**
* @return void
*/
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
if (!$container->hasDefinition(GeocoderDataCollector::class)) {
return;
Expand Down
11 changes: 9 additions & 2 deletions src/Mapping/Driver/AttributeDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function isGeocodeable(object $object): bool
}

/**
* @throws MappingException
* @throws MappingException|\ReflectionException
*/
public function loadMetadataFromObject(object $object): ClassMetadata
{
Expand Down Expand Up @@ -76,6 +76,8 @@ public function loadMetadataFromObject(object $object): ClassMetadata
* @param T $object
*
* @return \ReflectionClass<T>
*
* @throws \ReflectionException
*/
private static function getReflection(object $object): \ReflectionClass
{
Expand All @@ -84,7 +86,12 @@ private static function getReflection(object $object): \ReflectionClass
return ClassUtils::newReflectionObject($object);
}

if (PHP_VERSION_ID < 80400) {
/** @var \ReflectionClass<T> */
return new \ReflectionClass(DefaultProxyClassNameResolver::getClass($object));
}

/** @var \ReflectionClass<T> */
return new \ReflectionClass(DefaultProxyClassNameResolver::getClass($object));
return new \ReflectionClass($object);
}
}
6 changes: 3 additions & 3 deletions tests/Functional/GeocoderListenerTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php

Check warning on line 1 in tests/Functional/GeocoderListenerTest.php

View workflow job for this annotation

GitHub Actions / PHP-CS-Fixer

Found violation(s) of type: single_line_comment_spacing

declare(strict_types=1);

Expand Down Expand Up @@ -71,14 +71,14 @@
$kernel->addTestConfig(static function (ContainerBuilder $container) {
$container->prependExtensionConfig('doctrine', [
'orm' => [
'report_fields_where_declared' => true,
//'report_fields_where_declared' => true,
],
]);

if (method_exists(Configuration::class, 'setLazyGhostObjectEnabled') && Kernel::VERSION_ID >= 60100) {
$container->prependExtensionConfig('doctrine', [
'orm' => [
'enable_lazy_ghost_objects' => true,
//'enable_lazy_ghost_objects' => true,
],
]);
}
Expand All @@ -87,7 +87,7 @@
$container->prependExtensionConfig('doctrine', [
'orm' => [
'controller_resolver' => [
'auto_mapping' => false,
//'auto_mapping' => false,
],
],
]);
Expand Down
4 changes: 2 additions & 2 deletions tests/Functional/config/listener.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ doctrine:
driver: pdo_sqlite
path: '%kernel.cache_dir%/test.sqlite'
orm:
auto_generate_proxy_classes: true
#auto_generate_proxy_classes: true
validate_xml_mapping: true
report_fields_where_declared: true
#report_fields_where_declared: true
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
auto_mapping: false

Expand Down
Loading