Skip to content

Commit b58ec12

Browse files
authored
fix(metadata): correct interface aliases (#5766)
* fix: fatal with api interface Fix: #5761 * fix: coding standards and tests
1 parent 6007550 commit b58ec12

File tree

4 files changed

+27
-5
lines changed

4 files changed

+27
-5
lines changed

src/Api/IdentifiersExtractorInterface.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515

1616
class_exists(\ApiPlatform\Metadata\IdentifiersExtractorInterface::class);
1717

18-
if (!class_exists(IdentifiersExtractorInterface::class)) {
18+
class_alias(
19+
\ApiPlatform\Metadata\IdentifiersExtractorInterface::class,
20+
__NAMESPACE__.'\IdentifiersExtractorInterface'
21+
);
22+
23+
if (false) { // @phpstan-ignore-line
1924
interface IdentifiersExtractorInterface extends \ApiPlatform\Metadata\IdentifiersExtractorInterface
2025
{
2126
}

src/Api/IriConverterInterface.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515

1616
class_exists(\ApiPlatform\Metadata\IriConverterInterface::class);
1717

18-
if (!class_exists(IriConverterInterface::class)) {
18+
class_alias(
19+
\ApiPlatform\Metadata\IriConverterInterface::class,
20+
__NAMESPACE__.'\IriConverterInterface'
21+
);
22+
23+
if (false) { // @phpstan-ignore-line
1924
interface IriConverterInterface extends \ApiPlatform\Metadata\IriConverterInterface
2025
{
2126
}

src/Api/UriVariablesConverterInterface.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515

1616
class_exists(\ApiPlatform\Metadata\UriVariablesConverterInterface::class);
1717

18-
if (!class_exists(UriVariablesConverterInterface::class)) {
18+
class_alias(
19+
\ApiPlatform\Metadata\UriVariablesConverterInterface::class,
20+
__NAMESPACE__.'\UriVariablesConverterInterface'
21+
);
22+
23+
if (false) { // @phpstan-ignore-line
1924
interface UriVariablesConverterInterface extends \ApiPlatform\Metadata\UriVariablesConverterInterface
2025
{
2126
}

src/Api/UrlGeneratorInterface.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313

1414
namespace ApiPlatform\Api;
1515

16-
interface UrlGeneratorInterface extends \ApiPlatform\Metadata\UrlGeneratorInterface
17-
{
16+
class_alias(
17+
\ApiPlatform\Metadata\UrlGeneratorInterface::class,
18+
__NAMESPACE__.'\UrlGeneratorInterface'
19+
);
20+
21+
if (false) { // @phpstan-ignore-line
22+
interface UrlGeneratorInterface extends \ApiPlatform\Metadata\UrlGeneratorInterface
23+
{
24+
}
1825
}

0 commit comments

Comments
 (0)