2018-01-25 21:11:34 +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;
|
|
|
|
|
2020-05-28 13:19:11 +02:00
|
|
|
use OpenApi\Annotations\AbstractAnnotation;
|
2018-01-25 21:11:34 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @Annotation
|
|
|
|
*/
|
2021-12-21 17:16:14 +02:00
|
|
|
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
|
2018-01-25 21:11:34 +01:00
|
|
|
class Security extends AbstractAnnotation
|
|
|
|
{
|
|
|
|
/** {@inheritdoc} */
|
|
|
|
public static $_types = [
|
|
|
|
'name' => 'string',
|
2021-01-26 19:05:27 +01:00
|
|
|
'scopes' => '[string]',
|
2018-01-25 21:11:34 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
public static $_required = ['name'];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public $name;
|
2021-01-26 19:05:27 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string[]
|
|
|
|
*/
|
|
|
|
public $scopes = [];
|
2021-12-21 17:16:14 +02:00
|
|
|
|
|
|
|
public function __construct(
|
|
|
|
array $properties = [],
|
|
|
|
string $name = null,
|
|
|
|
array $scopes = []
|
|
|
|
) {
|
|
|
|
parent::__construct($properties + [
|
|
|
|
'name' => $name,
|
|
|
|
'scopes' => $scopes,
|
|
|
|
]);
|
|
|
|
}
|
2018-01-25 21:11:34 +01:00
|
|
|
}
|