vendor/nelmio/api-doc-bundle/PropertyDescriber/BooleanPropertyDescriber.php line 21

Open in your IDE?
  1. <?php
  2. /*
  3. * This file is part of the NelmioApiDocBundle package.
  4. *
  5. * (c) Nelmio
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Nelmio\ApiDocBundle\PropertyDescriber;
  11. use OpenApi\Annotations as OA;
  12. use Symfony\Component\PropertyInfo\Type;
  13. class BooleanPropertyDescriber implements PropertyDescriberInterface
  14. {
  15. use NullablePropertyTrait;
  16. public function describe(array $types, OA\Schema $property, array $groups = null)
  17. {
  18. $property->type = 'boolean';
  19. $this->setNullableProperty($types[0], $property);
  20. }
  21. public function supports(array $types): bool
  22. {
  23. return 1 === count($types) && Type::BUILTIN_TYPE_BOOL === $types[0]->getBuiltinType();
  24. }
  25. }