70 lines
1.3 KiB
PHP
Raw Normal View History

2017-01-14 17:36:56 +01:00
<?php
/*
* This file is part of the NelmioApiDocBundle package.
*
* (c) Nelmio
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Nelmio\ApiDocBundle\Annotation;
use OpenApi\Annotations\AbstractAnnotation;
use OpenApi\Annotations\Parameter;
use OpenApi\Generator;
2017-01-14 17:36:56 +01:00
/**
* @Annotation
*/
#[\Attribute(\Attribute::TARGET_METHOD)]
2017-01-14 17:36:56 +01:00
final class Model extends AbstractAnnotation
{
/** {@inheritdoc} */
2017-06-13 13:34:26 +02:00
public static $_types = [
'type' => 'string',
'groups' => '[string]',
'options' => '[mixed]',
2017-06-13 13:34:26 +02:00
];
2017-12-22 17:42:18 +00:00
2017-01-14 17:36:56 +01:00
public static $_required = ['type'];
2017-12-22 17:42:18 +00:00
2017-01-14 17:36:56 +01:00
public static $_parents = [
Parameter::class,
2017-01-14 17:36:56 +01:00
];
2017-06-13 13:34:26 +02:00
/**
* @var string
*/
2017-01-14 17:36:56 +01:00
public $type;
2017-06-13 13:34:26 +02:00
/**
* @var string[]
*/
public $groups;
/**
* @var mixed[]
*/
public $options;
/**
* @param mixed[] $properties
* @param string[] $groups
* @param mixed[] $options
*/
public function __construct(
array $properties = [],
string $type = Generator::UNDEFINED,
array $groups = null,
array $options = null
) {
parent::__construct($properties + [
'type' => $type,
'groups' => $groups,
'options' => $options,
]);
}
2017-01-14 17:36:56 +01:00
}