mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
cc97b0ba45
* Add support for php attributes * Fix tests for php 8.1 * Simplify the annotations * Revert the changes to the tests * CS * Test FOSRest parsing of attributes * CS * typo * CS * Test fetchArticle php 8.1 attributes * Fix namespaces Co-authored-by: Guilhem Niot <guilhem@gniot.fr>
51 lines
1006 B
PHP
51 lines
1006 B
PHP
<?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;
|
|
|
|
/**
|
|
* @Annotation
|
|
*/
|
|
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
|
|
class Security extends AbstractAnnotation
|
|
{
|
|
/** {@inheritdoc} */
|
|
public static $_types = [
|
|
'name' => 'string',
|
|
'scopes' => '[string]',
|
|
];
|
|
|
|
public static $_required = ['name'];
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
public $name;
|
|
|
|
/**
|
|
* @var string[]
|
|
*/
|
|
public $scopes = [];
|
|
|
|
public function __construct(
|
|
array $properties = [],
|
|
string $name = null,
|
|
array $scopes = []
|
|
) {
|
|
parent::__construct($properties + [
|
|
'name' => $name,
|
|
'scopes' => $scopes,
|
|
]);
|
|
}
|
|
}
|