mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-10 03:29:25 +03:00
Fix CS
This commit is contained in:
parent
76949ca537
commit
477442588a
@ -176,7 +176,7 @@ final class NelmioApiDocExtension extends Extension implements PrependExtensionI
|
|||||||
new Reference('annotations.reader'),
|
new Reference('annotations.reader'),
|
||||||
$config['media_types'],
|
$config['media_types'],
|
||||||
$jmsNamingStrategy,
|
$jmsNamingStrategy,
|
||||||
$container->getParameter('nelmio_api_doc.use_validation_groups')
|
$container->getParameter('nelmio_api_doc.use_validation_groups'),
|
||||||
])
|
])
|
||||||
->addTag('nelmio_api_doc.model_describer', ['priority' => 50]);
|
->addTag('nelmio_api_doc.model_describer', ['priority' => 50]);
|
||||||
|
|
||||||
|
@ -11,10 +11,8 @@
|
|||||||
|
|
||||||
namespace Nelmio\ApiDocBundle\Tests\Functional\Entity;
|
namespace Nelmio\ApiDocBundle\Tests\Functional\Entity;
|
||||||
|
|
||||||
use Nelmio\ApiDocBundle\Tests\ModelDescriber\Annotations\Fixture as CustomAssert;
|
|
||||||
use Symfony\Component\Validator\Constraint;
|
|
||||||
use Symfony\Component\Validator\Constraints as Assert;
|
|
||||||
use Symfony\Component\Serializer\Annotation\Groups;
|
use Symfony\Component\Serializer\Annotation\Groups;
|
||||||
|
use Symfony\Component\Validator\Constraints as Assert;
|
||||||
|
|
||||||
class SymfonyConstraintsWithValidationGroups
|
class SymfonyConstraintsWithValidationGroups
|
||||||
{
|
{
|
||||||
|
@ -19,9 +19,9 @@ use JMS\SerializerBundle\JMSSerializerBundle;
|
|||||||
use Nelmio\ApiDocBundle\NelmioApiDocBundle;
|
use Nelmio\ApiDocBundle\NelmioApiDocBundle;
|
||||||
use Nelmio\ApiDocBundle\Tests\Functional\Entity\BazingaUser;
|
use Nelmio\ApiDocBundle\Tests\Functional\Entity\BazingaUser;
|
||||||
use Nelmio\ApiDocBundle\Tests\Functional\Entity\JMSComplex;
|
use Nelmio\ApiDocBundle\Tests\Functional\Entity\JMSComplex;
|
||||||
use Nelmio\ApiDocBundle\Tests\Functional\Entity\SymfonyConstraintsWithValidationGroups;
|
|
||||||
use Nelmio\ApiDocBundle\Tests\Functional\Entity\NestedGroup\JMSPicture;
|
use Nelmio\ApiDocBundle\Tests\Functional\Entity\NestedGroup\JMSPicture;
|
||||||
use Nelmio\ApiDocBundle\Tests\Functional\Entity\PrivateProtectedExposure;
|
use Nelmio\ApiDocBundle\Tests\Functional\Entity\PrivateProtectedExposure;
|
||||||
|
use Nelmio\ApiDocBundle\Tests\Functional\Entity\SymfonyConstraintsWithValidationGroups;
|
||||||
use Nelmio\ApiDocBundle\Tests\Functional\ModelDescriber\VirtualTypeClassDoesNotExistsHandlerDefinedDescriber;
|
use Nelmio\ApiDocBundle\Tests\Functional\ModelDescriber\VirtualTypeClassDoesNotExistsHandlerDefinedDescriber;
|
||||||
use Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle;
|
use Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle;
|
||||||
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
|
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
|
||||||
@ -33,7 +33,6 @@ use Symfony\Component\DependencyInjection\Definition;
|
|||||||
use Symfony\Component\HttpKernel\Kernel;
|
use Symfony\Component\HttpKernel\Kernel;
|
||||||
use Symfony\Component\Routing\RouteCollectionBuilder;
|
use Symfony\Component\Routing\RouteCollectionBuilder;
|
||||||
use Symfony\Component\Serializer\Annotation\SerializedName;
|
use Symfony\Component\Serializer\Annotation\SerializedName;
|
||||||
use Symfony\Component\Validator\Constraint;
|
|
||||||
|
|
||||||
class TestKernel extends Kernel
|
class TestKernel extends Kernel
|
||||||
{
|
{
|
||||||
|
@ -12,12 +12,12 @@
|
|||||||
namespace Nelmio\ApiDocBundle\Tests\ModelDescriber\Annotations;
|
namespace Nelmio\ApiDocBundle\Tests\ModelDescriber\Annotations;
|
||||||
|
|
||||||
use Doctrine\Common\Annotations\AnnotationReader;
|
use Doctrine\Common\Annotations\AnnotationReader;
|
||||||
use Symfony\Component\Validator\Constraint;
|
|
||||||
use Nelmio\ApiDocBundle\ModelDescriber\Annotations\SymfonyConstraintAnnotationReader;
|
use Nelmio\ApiDocBundle\ModelDescriber\Annotations\SymfonyConstraintAnnotationReader;
|
||||||
use Nelmio\ApiDocBundle\Tests\Helper;
|
use Nelmio\ApiDocBundle\Tests\Helper;
|
||||||
use Nelmio\ApiDocBundle\Tests\ModelDescriber\Annotations\Fixture as CustomAssert;
|
use Nelmio\ApiDocBundle\Tests\ModelDescriber\Annotations\Fixture as CustomAssert;
|
||||||
use OpenApi\Annotations as OA;
|
use OpenApi\Annotations as OA;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use Symfony\Component\Validator\Constraint;
|
||||||
use Symfony\Component\Validator\Constraints as Assert;
|
use Symfony\Component\Validator\Constraints as Assert;
|
||||||
|
|
||||||
class SymfonyConstraintAnnotationReaderTest extends TestCase
|
class SymfonyConstraintAnnotationReaderTest extends TestCase
|
||||||
@ -488,7 +488,7 @@ class SymfonyConstraintAnnotationReaderTest extends TestCase
|
|||||||
$reader->updateProperty(
|
$reader->updateProperty(
|
||||||
new \ReflectionProperty($entity, 'property1'),
|
new \ReflectionProperty($entity, 'property1'),
|
||||||
$schema->properties[0],
|
$schema->properties[0],
|
||||||
["other"],
|
['other'],
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertSame(OA\UNDEFINED, $schema->required, 'should not have read constraint in default group');
|
$this->assertSame(OA\UNDEFINED, $schema->required, 'should not have read constraint in default group');
|
||||||
@ -512,7 +512,7 @@ class SymfonyConstraintAnnotationReaderTest extends TestCase
|
|||||||
$reader->updateProperty(
|
$reader->updateProperty(
|
||||||
new \ReflectionProperty($entity, 'property1'),
|
new \ReflectionProperty($entity, 'property1'),
|
||||||
$schema->properties[0],
|
$schema->properties[0],
|
||||||
["other", Constraint::DEFAULT_GROUP],
|
['other', Constraint::DEFAULT_GROUP],
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertSame(['property1'], $schema->required, 'should have read constraint in default group');
|
$this->assertSame(['property1'], $schema->required, 'should have read constraint in default group');
|
||||||
@ -532,7 +532,7 @@ class SymfonyConstraintAnnotationReaderTest extends TestCase
|
|||||||
if (\PHP_VERSION_ID >= 80000) {
|
if (\PHP_VERSION_ID >= 80000) {
|
||||||
yield 'Attributes' => [new class() {
|
yield 'Attributes' => [new class() {
|
||||||
#[Assert\NotBlank()]
|
#[Assert\NotBlank()]
|
||||||
#[Assert\Range(min: 1, group: ["other"])]
|
#[Assert\Range(min: 1, group: ['other'])]
|
||||||
private $property1;
|
private $property1;
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user