Skip to content

Commit

Permalink
remove 80 / 81 suffix classes
Browse files Browse the repository at this point in the history
  • Loading branch information
DjordyKoert committed Oct 24, 2024
1 parent e5081d6 commit 3f833b3
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 96 deletions.
8 changes: 0 additions & 8 deletions tests/Functional/Configs/AlternativeNamesPHP80Entities.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions tests/Functional/Configs/AlternativeNamesPHP81Entities.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions tests/Functional/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use Nelmio\ApiDocBundle\Tests\Functional\Entity\ArticleInterface;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\CompoundEntity;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\EntityThroughNameConverter;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\EntityWithAlternateType81;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\EntityWithAlternateType;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\EntityWithFalsyDefaults;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\EntityWithNullableSchemaSet;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\EntityWithObjectType;
Expand Down Expand Up @@ -306,7 +306,7 @@ public function symfonyConstraintsWithGroupsAction()
response: 200,
description: 'success',
content: new OA\JsonContent(
ref: new Model(type: EntityWithAlternateType81::class),
ref: new Model(type: EntityWithAlternateType::class),
),
)]
public function alternateEntityType()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Nelmio\ApiDocBundle\Tests\Functional\Controller;

use Nelmio\ApiDocBundle\Annotation\Model;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\EntityWithPromotedPropertiesWithDefaults81;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\EntityWithPromotedPropertiesWithDefaults;
use OpenApi\Attributes as OA;
use Symfony\Component\Routing\Annotation\Route;

Expand All @@ -29,7 +29,7 @@ class PromotedPropertiesController81
description: 'Operation automatically detected',
)]
#[OA\RequestBody(
content: new Model(type: EntityWithPromotedPropertiesWithDefaults81::class),
content: new Model(type: EntityWithPromotedPropertiesWithDefaults::class),
)]
public function entityWithPromotedPropertiesWithDefaults()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/ControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static function provideAttributeTestCases(): \Generator
],
'PromotedPropertiesDefaults',
[],
[__DIR__.'/Configs/AlternativeNamesPHP81Entities.yaml', ...self::cleanUnusedComponentsConfig()],
[...self::cleanUnusedComponentsConfig()],
];

yield 'JMS model opt out' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use OpenApi\Attributes as OA;

#[OA\Schema(type: 'array', items: new OA\Items(type: 'string'))]
class EntityWithAlternateType81 implements \IteratorAggregate
class EntityWithAlternateType implements \IteratorAggregate
{
/**
* @var string
Expand Down
33 changes: 0 additions & 33 deletions tests/Functional/Entity/EntityWithAlternateType80.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use Symfony\Component\Validator\Constraints as Assert;

class EntityWithPromotedPropertiesWithDefaults81
class EntityWithPromotedPropertiesWithDefaults
{
#[Assert\NotBlank]
public readonly string $nonNullableNonPromotedPropertyWithDefault;
Expand Down

This file was deleted.

6 changes: 1 addition & 5 deletions tests/Functional/FunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -863,11 +863,7 @@ public function testEnumSupport(): void

public function testEntitiesWithOverriddenSchemaTypeDoNotReadOtherProperties(): void
{
if (TestKernel::isAttributesAvailable()) {
$model = $this->getModel('EntityWithAlternateType81');
} else {
$model = $this->getModel('EntityWithAlternateType80');
}
$model = $this->getModel('EntityWithAlternateType');

self::assertSame('array', $model->type);
self::assertSame('string', $model->items->type);
Expand Down

0 comments on commit 3f833b3

Please sign in to comment.