Skip to content

Commit ca463a3

Browse files
authored
Merge pull request #780 from doctrine/4.4.x-merge-up-into-5.0.x_V9RvRLEU
Merge release 4.4.2 into 5.0.x
2 parents f5df632 + 8c19b13 commit ca463a3

File tree

9 files changed

+32
-23
lines changed

9 files changed

+32
-23
lines changed

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
},
6969
"require-dev": {
7070
"doctrine/coding-standard": "^9.0.0",
71-
"doctrine/orm": "^2.10.4",
71+
"doctrine/orm": "^2.10.5",
7272
"jangregor/phpstan-prophecy": "^1.0.0",
7373
"laminas/laminas-cache-storage-adapter-blackhole": "^2.0.0",
7474
"laminas/laminas-cache-storage-adapter-memory": "^2.0.0",
@@ -83,6 +83,9 @@
8383
"predis/predis": "^1.1.9",
8484
"vimeo/psalm": "^4.16.1"
8585
},
86+
"conflict": {
87+
"doctrine/orm": "2.12.0"
88+
},
8689
"suggest": {
8790
"doctrine/data-fixtures": "Data Fixtures if you want to generate test data or bootstrap data for your deployments",
8891
"laminas/laminas-mvc-console": "^1.1.11 if you want to use the Laminas console libraries"

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ parameters:
55
- src
66
- tests
77
includes:
8+
- vendor/phpstan/phpstan-phpunit/extension.neon
89
- vendor/phpstan/phpstan-phpunit/rules.neon
910
- vendor/jangregor/phpstan-prophecy/extension.neon

src/Form/Element/Proxy.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
use function current;
2525
use function get_class;
2626
use function gettype;
27-
use function interface_exists;
2827
use function is_callable;
2928
use function is_object;
3029
use function is_string;
@@ -594,5 +593,3 @@ protected function loadValueOptions(): void
594593
$this->valueOptions = $options;
595594
}
596595
}
597-
598-
interface_exists(ObjectManager::class);

src/Options/Authentication.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use Laminas\Stdlib\AbstractOptions;
1313

1414
use function gettype;
15-
use function interface_exists;
1615
use function is_callable;
1716
use function is_string;
1817
use function sprintf;
@@ -256,6 +255,3 @@ public function setStorage($storage): void
256255
$this->storage = $storage;
257256
}
258257
}
259-
260-
interface_exists(ClassMetadata::class);
261-
interface_exists(ObjectRepository::class);

src/Persistence/ObjectManagerAwareInterface.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
use Doctrine\Persistence\ObjectManager;
88

9-
use function interface_exists;
10-
119
interface ObjectManagerAwareInterface
1210
{
1311
/**
@@ -20,5 +18,3 @@ public function setObjectManager(ObjectManager $objectManager): void;
2018
*/
2119
public function getObjectManager(): ObjectManager;
2220
}
23-
24-
interface_exists(ObjectManager::class);

src/Persistence/ProvidesObjectManager.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
use Doctrine\Persistence\ObjectManager;
88

9-
use function interface_exists;
10-
119
/**
1210
* Trait to provide object manager to a form (only works from PHP 5.4)
1311
*/
@@ -31,5 +29,3 @@ public function getObjectManager(): ObjectManager
3129
return $this->objectManager;
3230
}
3331
}
34-
35-
interface_exists(ObjectManager::class);

src/Service/DriverFactory.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
use function class_exists;
2020
use function get_class;
21-
use function interface_exists;
2221
use function is_subclass_of;
2322
use function sprintf;
2423

@@ -128,5 +127,3 @@ protected function createDriver(ContainerInterface $container, Driver $options):
128127
return $driver;
129128
}
130129
}
131-
132-
interface_exists(MappingDriver::class);

src/Validator/Service/AbstractValidatorFactory.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use Laminas\Stdlib\ArrayUtils;
1414

1515
use function class_exists;
16-
use function interface_exists;
1716
use function is_string;
1817
use function sprintf;
1918

@@ -98,6 +97,3 @@ protected function merge(array $previousOptions, array $newOptions): array
9897
return ArrayUtils::merge($previousOptions, $newOptions, true);
9998
}
10099
}
101-
102-
interface_exists(ObjectManager::class);
103-
interface_exists(ObjectRepository::class);

tests/Service/DriverFactoryTest.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
namespace DoctrineModuleTest\Service;
66

7+
use Doctrine\Common\Annotations\Reader;
8+
use Doctrine\Common\Cache\ArrayCache;
9+
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
710
use Doctrine\ORM\Mapping\Driver\AttributeDriver;
811
use Doctrine\Persistence\Mapping\Driver\MappingDriverChain;
912
use DoctrineModule\Service\DriverFactory;
@@ -90,4 +93,28 @@ public function testCreateAttributeDriver(): void
9093
$driver = $factory->__invoke($serviceManager, AttributeDriver::class);
9194
$this->assertInstanceOf(AttributeDriver::class, $driver);
9295
}
96+
97+
public function testCreateAnnotationDriver(): void
98+
{
99+
$serviceManager = new ServiceManager();
100+
$serviceManager->setService(
101+
'config',
102+
[
103+
'doctrine' => [
104+
'driver' => [
105+
'testDriver' => ['class' => AnnotationDriver::class],
106+
],
107+
],
108+
]
109+
);
110+
$serviceManager->setService(
111+
'doctrine.cache.array',
112+
new ArrayCache()
113+
);
114+
115+
$factory = new DriverFactory('testDriver');
116+
$driver = $factory->__invoke($serviceManager, AnnotationDriver::class);
117+
$this->assertInstanceOf(AnnotationDriver::class, $driver);
118+
$this->assertInstanceOf(Reader::class, $driver->getReader());
119+
}
93120
}

0 commit comments

Comments
 (0)