Skip to content

Commit 8f1ebfb

Browse files
committed
Add exception if no doctrine/orm:^3.0.1
1 parent f9c328f commit 8f1ebfb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Doctrine/Orm/Filter/UuidBinaryFilter.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,21 @@
1313

1414
namespace ApiPlatform\Doctrine\Orm\Filter;
1515

16+
use Composer\InstalledVersions;
17+
use Composer\Semver\VersionParser;
1618
use Doctrine\DBAL\ArrayParameterType;
1719
use Doctrine\DBAL\ParameterType;
1820

1921
final class UuidBinaryFilter extends AbstractUuidFilter
2022
{
23+
public function __construct()
24+
{
25+
if (!InstalledVersions::satisfies(new VersionParser, 'doctrine/orm', '^3.0.1')) {
26+
// @see https://github.com/doctrine/orm/pull/11287
27+
throw new \LogicException('The "doctrine/orm" package version 3.0.1 or higher is required to use the UuidBinaryFilter. Please upgrade your dependencies.');
28+
}
29+
}
30+
2131
protected function getDoctrineParameterType(): ParameterType
2232
{
2333
return ParameterType::BINARY;

0 commit comments

Comments
 (0)