Skip to content

Commit

Permalink
style: apply styleci diff (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
DjordyKoert authored Dec 20, 2023
1 parent 5ba6a55 commit adc739f
Show file tree
Hide file tree
Showing 35 changed files with 104 additions and 118 deletions.
13 changes: 7 additions & 6 deletions Tests/Functional/Controller/ApiController81.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,10 @@

use Nelmio\ApiDocBundle\Annotation\Areas;
use Nelmio\ApiDocBundle\Annotation\Model;
use Nelmio\ApiDocBundle\Annotation\Operation;
use Nelmio\ApiDocBundle\Annotation\Security;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\Article;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\Article81;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\SymfonyDiscriminator81;
use Nelmio\ApiDocBundle\Tests\Functional\EntityExcluded\Symfony7\SerializedNameEntity;
use OpenApi\Attributes as OA;
use Symfony\Component\Routing\Annotation\Route;
use Nelmio\ApiDocBundle\Annotation\Operation;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\ArticleInterface;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\CompoundEntity;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\EntityWithAlternateType81;
Expand All @@ -29,13 +25,17 @@
use Nelmio\ApiDocBundle\Tests\Functional\Entity\EntityWithRef;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\SymfonyConstraints81;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\SymfonyConstraintsWithValidationGroups;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\SymfonyDiscriminator81;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\SymfonyDiscriminatorFileMapping;
use Nelmio\ApiDocBundle\Tests\Functional\Entity\User;
use Nelmio\ApiDocBundle\Tests\Functional\EntityExcluded\Symfony7\SerializedNameEntity;
use Nelmio\ApiDocBundle\Tests\Functional\Form\DummyType;
use Nelmio\ApiDocBundle\Tests\Functional\Form\FormWithAlternateSchemaType;
use Nelmio\ApiDocBundle\Tests\Functional\Form\FormWithModel;
use Nelmio\ApiDocBundle\Tests\Functional\Form\FormWithRefType;
use Nelmio\ApiDocBundle\Tests\Functional\Form\UserType;
use OpenApi\Attributes as OA;
use Symfony\Component\Routing\Annotation\Route;

class ApiController81
{
Expand All @@ -53,6 +53,7 @@ class ApiController81
public function fetchArticleAction()
{
}

#[OA\Get(
responses: [
new OA\Response(
Expand All @@ -61,7 +62,7 @@ public function fetchArticleAction()
attachables: [
new Model(type: ArticleInterface::class, groups: ['light']),
],
)
),
],
)]
#[OA\Parameter(ref: '#/components/parameters/test')]
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/Controller/ClassApiController80.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ class ClassApiController80
public function securityAction()
{
}
}
}
2 changes: 1 addition & 1 deletion Tests/Functional/Controller/ClassApiController81.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class ClassApiController81
public function securityAction()
{
}
}
}
2 changes: 1 addition & 1 deletion Tests/Functional/Controller/FOSRestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Symfony\Component\Routing\Annotation\Route;

if (TestKernel::isAttributesAvailable()) {
#[Route("/api", host: "api.example.com")]
#[Route('/api', host: 'api.example.com')]
class FOSRestController extends FOSRestController81
{
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/Controller/InvokableController80.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ class InvokableController80
public function __invoke()
{
}
}
}
2 changes: 1 addition & 1 deletion Tests/Functional/Controller/InvokableController81.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class InvokableController81
public function __invoke()
{
}
}
}
3 changes: 1 addition & 2 deletions Tests/Functional/Controller/JMSController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ class JMSController extends JMSController80
{
}
} else {
#[Route(host: "api.example.com")]
#[Route(host: 'api.example.com')]
class JMSController extends JMSController81
{
}
}

50 changes: 25 additions & 25 deletions Tests/Functional/Controller/JMSController81.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,95 +26,95 @@

class JMSController81
{
#[Route("/api/jms", methods: ["GET"])]
#[Route('/api/jms', methods: ['GET'])]
#[OA\Response(
response: 200,
description: "Success",
description: 'Success',
content: new Model(type: JMSUser::class)
)]
public function userAction()
{
}

#[Route("/api/yaml", methods: ["GET"])]
#[Route('/api/yaml', methods: ['GET'])]
#[OA\Response(
response: 200,
description: "Success",
description: 'Success',
content: new Model(type: VirtualProperty::class)
)]
public function yamlAction()
{
}

#[Route("/api/jms_complex", methods: ["GET"])]
#[Route('/api/jms_complex', methods: ['GET'])]
#[OA\Response(
response: 200,
description: "Success",
description: 'Success',
content: new Model(
type: JMSComplex81::class,
groups: ["list", "details", "User" => ["list"]])
groups: ['list', 'details', 'User' => ['list']])
)]
public function complexAction()
{
}

#[Route("/api/jms_complex_dual", methods: ["GET"])]
#[Route('/api/jms_complex_dual', methods: ['GET'])]
#[OA\Response(
response: 200,
description: "Success",
description: 'Success',
content: new Model(
type: JMSDualComplex::class,
groups: ["Default", "complex" => ["User" => ["details"]]])
groups: ['Default', 'complex' => ['User' => ['details']]])
)]
public function complexDualAction()
{
}

#[Route("/api/jms_naming_strategy", methods: ["GET"])]
#[Route('/api/jms_naming_strategy', methods: ['GET'])]
#[OA\Response(
response: 200,
description: "Success",
content: new Model(type: JMSNamingStrategyConstraints::class, groups: ["Default"])
description: 'Success',
content: new Model(type: JMSNamingStrategyConstraints::class, groups: ['Default'])
)]
public function namingStrategyConstraintsAction()
{
}

#[Route("/api/jms_chat", methods: ["GET"])]
#[Route('/api/jms_chat', methods: ['GET'])]
#[OA\Response(
response: 200,
description: "Success",
content: new Model(type: JMSChat::class, groups: ["Default", "members" => ["mini"]])
description: 'Success',
content: new Model(type: JMSChat::class, groups: ['Default', 'members' => ['mini']])
)]
public function chatAction()
{
}

#[Route("/api/jms_picture", methods: ["GET"])]
#[Route('/api/jms_picture', methods: ['GET'])]
#[OA\Response(
response: 200,
description: "Success",
content: new Model(type: JMSPicture::class, groups: ["mini"])
description: 'Success',
content: new Model(type: JMSPicture::class, groups: ['mini'])
)]
public function pictureAction()
{
}

#[Route("/api/jms_mini_user", methods: ["GET"])]
#[Route('/api/jms_mini_user', methods: ['GET'])]
#[OA\Response(
response: 200,
description: "Success",
content: new Model(type: JMSChatUser::class, groups: ["mini"])
description: 'Success',
content: new Model(type: JMSChatUser::class, groups: ['mini'])
)]
public function minUserAction()
{
}

#[Route("/api/jms_mini_user_nested", methods: ["GET"])]
#[Route('/api/jms_mini_user_nested', methods: ['GET'])]
#[OA\Response(
response: 200,
description: "Success",
content: new Model(type: JMSChatRoomUser::class, groups: ["mini", "friend" => ["living" => ["Default"]]])
description: 'Success',
content: new Model(type: JMSChatRoomUser::class, groups: ['mini', 'friend' => ['living' => ['Default']]])
)]
public function minUserNestedAction()
{
Expand Down
3 changes: 1 addition & 2 deletions Tests/Functional/Entity/EntityWithAlternateType80.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use ArrayIterator;
use IteratorAggregate;
use Nelmio\ApiDocBundle\Tests\Functional\TestKernel;
use OpenApi\Annotations as OA;

/**
Expand All @@ -33,4 +32,4 @@ public function getIterator(): ArrayIterator
'def',
]);
}
}
}
3 changes: 1 addition & 2 deletions Tests/Functional/Entity/EntityWithAlternateType81.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use ArrayIterator;
use IteratorAggregate;
use Nelmio\ApiDocBundle\Tests\Functional\TestKernel;
use OpenApi\Attributes as OA;

#[OA\Schema(type: 'array', items: new OA\Items(type: 'string'))]
Expand All @@ -31,4 +30,4 @@ public function getIterator(): ArrayIterator
'def',
]);
}
}
}
20 changes: 10 additions & 10 deletions Tests/Functional/Entity/JMSComplex81.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,37 @@
use Nelmio\ApiDocBundle\Annotation\Model;
use OpenApi\Attributes as OA;

#[Serializer\ExclusionPolicy("all")]
#[Serializer\ExclusionPolicy('all')]
#[OA\Schema(
required: ["id", "user"],
required: ['id', 'user'],
properties: [
new OA\Property(
property: "virtual",
property: 'virtual',
ref: new Model(type: JMSUser::class)
),
],
)]
class JMSComplex81
{
#[Serializer\Type("integer")]
#[Serializer\Type('integer')]
#[Serializer\Expose]
#[Serializer\Groups(["list"])]
#[Serializer\Groups(['list'])]
private $id;

#[OA\Property(ref: new Model(type: JMSUser::class))]
#[Serializer\Expose]
#[Serializer\Groups(["details"])]
#[Serializer\SerializedName("user")]
#[Serializer\Groups(['details'])]
#[Serializer\SerializedName('user')]
private $User;

#[Serializer\Type("string")]
#[Serializer\Type('string')]
#[Serializer\Expose]
#[Serializer\Groups(["list"])]
#[Serializer\Groups(['list'])]
private $name;

#[Serializer\VirtualProperty]
#[Serializer\Expose]
#[Serializer\Groups(["list"])]
#[Serializer\Groups(['list'])]
#[OA\Property(ref: new Model(type: JMSUser::class))]
public function getVirtualFriend()
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/Entity/JMSDualComplex.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ class JMSDualComplex extends JMSDualComplex80
class JMSDualComplex extends JMSDualComplex81
{
}
}
}
2 changes: 0 additions & 2 deletions Tests/Functional/Entity/JMSNamingStrategyConstraints.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

namespace Nelmio\ApiDocBundle\Tests\Functional\Entity;

use JMS\Serializer\Annotation as Serializer;
use Nelmio\ApiDocBundle\Tests\Functional\TestKernel;
use Symfony\Component\Validator\Constraints as Assert;

if (TestKernel::isAnnotationsAvailable()) {
class JMSNamingStrategyConstraints extends JMSNamingStrategyConstraints80
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/Entity/JMSNote.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ class JMSNote extends JMSNote80
class JMSNote extends JMSNote81
{
}
}
}
2 changes: 1 addition & 1 deletion Tests/Functional/Entity/JMSUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ class JMSUser extends JMSUser80
class JMSUser extends JMSUser81
{
}
}
}
Loading

0 comments on commit adc739f

Please sign in to comment.