Skip to content

Commit 59826bb

Browse files
liviucmgLiviu Mirea
authored andcommitted
fix: only alias if exists for opcache preload
Fixes api-platform/api-platform#2284 (#5110) Co-authored-by: Liviu Mirea <[email protected]>
1 parent 27fcdc6 commit 59826bb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/deprecation.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@
1212
declare(strict_types=1);
1313

1414
// Must be declared first!
15-
class_alias(ApiPlatform\Api\FilterInterface::class, ApiPlatform\Core\Api\FilterInterface::class);
16-
class_alias(ApiPlatform\Api\ResourceClassResolverInterface::class, ApiPlatform\Core\Api\ResourceClassResolverInterface::class);
15+
if (!interface_exists(ApiPlatform\Core\Api\FilterInterface::class)) {
16+
class_alias(ApiPlatform\Api\FilterInterface::class, ApiPlatform\Core\Api\FilterInterface::class);
17+
}
18+
if (!interface_exists(ApiPlatform\Core\Api\ResourceClassResolverInterface::class)) {
19+
class_alias(ApiPlatform\Api\ResourceClassResolverInterface::class, ApiPlatform\Core\Api\ResourceClassResolverInterface::class);
20+
}
1721

1822
$deprecatedInterfaces = include 'deprecated_interfaces.php';
1923
foreach ($deprecatedInterfaces as $oldInterfaceName => $interfaceName) {

0 commit comments

Comments
 (0)