diff --git a/composer.json b/composer.json index ef43831c..023e912f 100644 --- a/composer.json +++ b/composer.json @@ -59,7 +59,7 @@ "require-dev": { "composer/package-versions-deprecated": "^1.11", "doctrine/annotations": "^1.7 || ^2.0", - "friendsofphp/php-cs-fixer": "^2.17 || ^3.47.1", + "friendsofphp/php-cs-fixer": "^2.17 || 3.62.0", "phpstan/phpstan": "^1.6", "phpunit/phpunit": ">=8", "vimeo/psalm": "^4.23" diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 0fa9f3fc..e0ff673d 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -55,6 +55,16 @@ parameters: count: 1 path: src/Generator.php + - + message: "#^Result of && is always false\\.$#" + count: 3 + path: src/Processors/AugmentProperties.php + + - + message: "#^Strict comparison using \\=\\=\\= between non\\-empty\\-string and '' will always evaluate to false\\.$#" + count: 1 + path: src/Processors/AugmentProperties.php + - message: "#^Call to function is_array\\(\\) with bool\\|OpenApi\\\\Annotations\\\\AdditionalProperties will always evaluate to false\\.$#" count: 1 diff --git a/src/Attributes/AdditionalProperties.php b/src/Attributes/AdditionalProperties.php index 16781a8f..42a525a7 100644 --- a/src/Attributes/AdditionalProperties.php +++ b/src/Attributes/AdditionalProperties.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS)] -class AdditionalProperties extends \OpenApi\Annotations\AdditionalProperties +class AdditionalProperties extends OA\AdditionalProperties { /** * @param string|non-empty-array|null $type @@ -19,9 +20,9 @@ class AdditionalProperties extends \OpenApi\Annotations\AdditionalProperties * @param int|float $maximum * @param int|float $minimum * @param array|class-string|null $enum - * @param array $allOf - * @param array $anyOf - * @param array $oneOf + * @param array $allOf + * @param array $anyOf + * @param array $oneOf * @param array|null $x * @param Attachable[]|null $attachables */ diff --git a/src/Attributes/Attachable.php b/src/Attributes/Attachable.php index 0fc6fa78..4056db1d 100644 --- a/src/Attributes/Attachable.php +++ b/src/Attributes/Attachable.php @@ -6,8 +6,10 @@ namespace OpenApi\Attributes; +use OpenApi\Annotations as OA; + #[\Attribute(\Attribute::TARGET_ALL | \Attribute::IS_REPEATABLE)] -class Attachable extends \OpenApi\Annotations\Attachable +class Attachable extends OA\Attachable { public function __construct(array $properties = []) { diff --git a/src/Attributes/Components.php b/src/Attributes/Components.php index 853717e1..c2c91cd0 100644 --- a/src/Attributes/Components.php +++ b/src/Attributes/Components.php @@ -7,21 +7,22 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS)] -class Components extends \OpenApi\Annotations\Components +class Components extends OA\Components { /** - * @param array|null $schemas - * @param Response[]|null $responses - * @param Parameter[]|null $parameters - * @param RequestBody[]|null $requestBodies - * @param array|null $examples - * @param Header[]|null $headers - * @param SecurityScheme[]|null $securitySchemes - * @param Link[]|null $links - * @param array|null $x - * @param Attachable[]|null $attachables + * @param array|null $schemas + * @param Response[]|null $responses + * @param Parameter[]|null $parameters + * @param RequestBody[]|null $requestBodies + * @param array|null $examples + * @param Header[]|null $headers + * @param SecurityScheme[]|null $securitySchemes + * @param Link[]|null $links + * @param array|null $x + * @param Attachable[]|null $attachables */ public function __construct( ?array $schemas = null, diff --git a/src/Attributes/Contact.php b/src/Attributes/Contact.php index 332979e7..0b3cd317 100644 --- a/src/Attributes/Contact.php +++ b/src/Attributes/Contact.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS)] -class Contact extends \OpenApi\Annotations\Contact +class Contact extends OA\Contact { /** * @param array|null $x diff --git a/src/Attributes/Delete.php b/src/Attributes/Delete.php index d2f1c733..d597b7ad 100644 --- a/src/Attributes/Delete.php +++ b/src/Attributes/Delete.php @@ -6,8 +6,10 @@ namespace OpenApi\Attributes; +use OpenApi\Annotations as OA; + #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Delete extends \OpenApi\Annotations\Delete +class Delete extends OA\Delete { use OperationTrait; } diff --git a/src/Attributes/Discriminator.php b/src/Attributes/Discriminator.php index 8b78713d..f97f84a8 100644 --- a/src/Attributes/Discriminator.php +++ b/src/Attributes/Discriminator.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS)] -class Discriminator extends \OpenApi\Annotations\Discriminator +class Discriminator extends OA\Discriminator { /** * @param string[]|null $mapping diff --git a/src/Attributes/Examples.php b/src/Attributes/Examples.php index fd936bd5..05818aa9 100644 --- a/src/Attributes/Examples.php +++ b/src/Attributes/Examples.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY | \Attribute::IS_REPEATABLE)] -class Examples extends \OpenApi\Annotations\Examples +class Examples extends OA\Examples { /** * @param string|class-string|object|null $ref diff --git a/src/Attributes/ExternalDocumentation.php b/src/Attributes/ExternalDocumentation.php index f9bfa94b..65108df9 100644 --- a/src/Attributes/ExternalDocumentation.php +++ b/src/Attributes/ExternalDocumentation.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS)] -class ExternalDocumentation extends \OpenApi\Annotations\ExternalDocumentation +class ExternalDocumentation extends OA\ExternalDocumentation { /** * @param array|null $x diff --git a/src/Attributes/Flow.php b/src/Attributes/Flow.php index 80e6ebce..658bd583 100644 --- a/src/Attributes/Flow.php +++ b/src/Attributes/Flow.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS)] -class Flow extends \OpenApi\Annotations\Flow +class Flow extends OA\Flow { /** * @param array|null $x diff --git a/src/Attributes/Get.php b/src/Attributes/Get.php index 81e5ad82..59de6196 100644 --- a/src/Attributes/Get.php +++ b/src/Attributes/Get.php @@ -6,8 +6,10 @@ namespace OpenApi\Attributes; +use OpenApi\Annotations as OA; + #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Get extends \OpenApi\Annotations\Get +class Get extends OA\Get { use OperationTrait; } diff --git a/src/Attributes/Head.php b/src/Attributes/Head.php index 48ebb01e..9f7bf6df 100644 --- a/src/Attributes/Head.php +++ b/src/Attributes/Head.php @@ -6,8 +6,10 @@ namespace OpenApi\Attributes; +use OpenApi\Annotations as OA; + #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Head extends \OpenApi\Annotations\Head +class Head extends OA\Head { use OperationTrait; } diff --git a/src/Attributes/Header.php b/src/Attributes/Header.php index 4404aaff..8fe516f8 100644 --- a/src/Attributes/Header.php +++ b/src/Attributes/Header.php @@ -6,9 +6,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Header extends \OpenApi\Annotations\Header +class Header extends OA\Header { /** * @param string|class-string|object|null $ref diff --git a/src/Attributes/Info.php b/src/Attributes/Info.php index 39348f56..707f34d7 100644 --- a/src/Attributes/Info.php +++ b/src/Attributes/Info.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS)] -class Info extends \OpenApi\Annotations\Info +class Info extends OA\Info { /** * @param array|null $x diff --git a/src/Attributes/Items.php b/src/Attributes/Items.php index 4aba6a63..9c5aa701 100644 --- a/src/Attributes/Items.php +++ b/src/Attributes/Items.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD)] -class Items extends \OpenApi\Annotations\Items +class Items extends OA\Items { /** * @param string|non-empty-array|null $type @@ -19,9 +20,9 @@ class Items extends \OpenApi\Annotations\Items * @param int|float $maximum * @param int|float $minimum * @param array|class-string|null $enum - * @param array $allOf - * @param array $anyOf - * @param array $oneOf + * @param array $allOf + * @param array $anyOf + * @param array $oneOf * @param array|null $x * @param Attachable[]|null $attachables */ diff --git a/src/Attributes/JsonContent.php b/src/Attributes/JsonContent.php index d6797830..edac60c3 100644 --- a/src/Attributes/JsonContent.php +++ b/src/Attributes/JsonContent.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS)] -class JsonContent extends \OpenApi\Annotations\JsonContent +class JsonContent extends OA\JsonContent { /** * @param string|non-empty-array|null $type @@ -20,9 +21,9 @@ class JsonContent extends \OpenApi\Annotations\JsonContent * @param int|float $maximum * @param int|float $minimum * @param array|class-string|null $enum - * @param array $allOf - * @param array $anyOf - * @param array $oneOf + * @param array $allOf + * @param array $anyOf + * @param array $oneOf * @param array|null $x * @param Attachable[]|null $attachables */ diff --git a/src/Attributes/License.php b/src/Attributes/License.php index b9292375..4cddd4f6 100644 --- a/src/Attributes/License.php +++ b/src/Attributes/License.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS)] -class License extends \OpenApi\Annotations\License +class License extends OA\License { /** * @param array|null $x diff --git a/src/Attributes/Link.php b/src/Attributes/Link.php index c26600b0..91c6c98a 100644 --- a/src/Attributes/Link.php +++ b/src/Attributes/Link.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD)] -class Link extends \OpenApi\Annotations\Link +class Link extends OA\Link { /** * @param string|class-string|object|null $ref diff --git a/src/Attributes/MediaType.php b/src/Attributes/MediaType.php index 705cfcee..22e23abb 100644 --- a/src/Attributes/MediaType.php +++ b/src/Attributes/MediaType.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS)] -class MediaType extends \OpenApi\Annotations\MediaType +class MediaType extends OA\MediaType { /** * @param array $examples diff --git a/src/Attributes/OpenApi.php b/src/Attributes/OpenApi.php index c1af0145..014c5806 100644 --- a/src/Attributes/OpenApi.php +++ b/src/Attributes/OpenApi.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS)] -class OpenApi extends \OpenApi\Annotations\OpenApi +class OpenApi extends OA\OpenApi { /** * @param Server[]|null $servers diff --git a/src/Attributes/Options.php b/src/Attributes/Options.php index 086927f8..36f8ab2b 100644 --- a/src/Attributes/Options.php +++ b/src/Attributes/Options.php @@ -6,8 +6,10 @@ namespace OpenApi\Attributes; +use OpenApi\Annotations as OA; + #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Options extends \OpenApi\Annotations\Options +class Options extends OA\Options { use OperationTrait; } diff --git a/src/Attributes/Parameter.php b/src/Attributes/Parameter.php index 5fc157e1..84bbfd65 100644 --- a/src/Attributes/Parameter.php +++ b/src/Attributes/Parameter.php @@ -6,8 +6,10 @@ namespace OpenApi\Attributes; +use OpenApi\Annotations as OA; + #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] -class Parameter extends \OpenApi\Annotations\Parameter +class Parameter extends OA\Parameter { use ParameterTrait; } diff --git a/src/Attributes/Patch.php b/src/Attributes/Patch.php index 1a0a3c86..5cb95eca 100644 --- a/src/Attributes/Patch.php +++ b/src/Attributes/Patch.php @@ -6,8 +6,10 @@ namespace OpenApi\Attributes; +use OpenApi\Annotations as OA; + #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Patch extends \OpenApi\Annotations\Patch +class Patch extends OA\Patch { use OperationTrait; } diff --git a/src/Attributes/PathItem.php b/src/Attributes/PathItem.php index a946073e..80632790 100644 --- a/src/Attributes/PathItem.php +++ b/src/Attributes/PathItem.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class PathItem extends \OpenApi\Annotations\PathItem +class PathItem extends OA\PathItem { /** * @param string|class-string|object|null $ref diff --git a/src/Attributes/Post.php b/src/Attributes/Post.php index 716a51c2..369e6f14 100644 --- a/src/Attributes/Post.php +++ b/src/Attributes/Post.php @@ -6,8 +6,10 @@ namespace OpenApi\Attributes; +use OpenApi\Annotations as OA; + #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Post extends \OpenApi\Annotations\Post +class Post extends OA\Post { use OperationTrait; } diff --git a/src/Attributes/Property.php b/src/Attributes/Property.php index 87b4f7cb..91a911b7 100644 --- a/src/Attributes/Property.php +++ b/src/Attributes/Property.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_PARAMETER | \Attribute::TARGET_CLASS_CONSTANT | \Attribute::IS_REPEATABLE)] -class Property extends \OpenApi\Annotations\Property +class Property extends OA\Property { /** * @param string|non-empty-array|null $type @@ -19,9 +20,9 @@ class Property extends \OpenApi\Annotations\Property * @param int|float $maximum * @param int|float $minimum * @param array|class-string|null $enum - * @param array $allOf - * @param array $anyOf - * @param array $oneOf + * @param array $allOf + * @param array $anyOf + * @param array $oneOf * @param array|null $x * @param Attachable[]|null $attachables */ diff --git a/src/Attributes/Put.php b/src/Attributes/Put.php index 21331020..42a3252f 100644 --- a/src/Attributes/Put.php +++ b/src/Attributes/Put.php @@ -6,8 +6,10 @@ namespace OpenApi\Attributes; +use OpenApi\Annotations as OA; + #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Put extends \OpenApi\Annotations\Put +class Put extends OA\Put { use OperationTrait; } diff --git a/src/Attributes/Schema.php b/src/Attributes/Schema.php index 8a7e8cff..6cceff27 100644 --- a/src/Attributes/Schema.php +++ b/src/Attributes/Schema.php @@ -8,9 +8,10 @@ use OpenApi\Annotations\Examples; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY | \Attribute::IS_REPEATABLE)] -class Schema extends \OpenApi\Annotations\Schema +class Schema extends OA\Schema { /** * @param string|non-empty-array|null $type @@ -21,9 +22,9 @@ class Schema extends \OpenApi\Annotations\Schema * @param int|float $minimum * @param array|class-string|null $enum * @param array $examples - * @param array $allOf - * @param array $anyOf - * @param array $oneOf + * @param array $allOf + * @param array $anyOf + * @param array $oneOf * @param array|null $x * @param Attachable[]|null $attachables */ diff --git a/src/Attributes/SecurityScheme.php b/src/Attributes/SecurityScheme.php index e43c274b..eca9ebbc 100644 --- a/src/Attributes/SecurityScheme.php +++ b/src/Attributes/SecurityScheme.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY | \Attribute::IS_REPEATABLE)] -class SecurityScheme extends \OpenApi\Annotations\SecurityScheme +class SecurityScheme extends OA\SecurityScheme { /** * @param string|non-empty-array|null $type diff --git a/src/Attributes/Server.php b/src/Attributes/Server.php index 337d5950..8da08943 100644 --- a/src/Attributes/Server.php +++ b/src/Attributes/Server.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] -class Server extends \OpenApi\Annotations\Server +class Server extends OA\Server { /** * @param ServerVariable[] $variables diff --git a/src/Attributes/ServerVariable.php b/src/Attributes/ServerVariable.php index f9392664..3734f684 100644 --- a/src/Attributes/ServerVariable.php +++ b/src/Attributes/ServerVariable.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS)] -class ServerVariable extends \OpenApi\Annotations\ServerVariable +class ServerVariable extends OA\ServerVariable { /** * @param array|class-string|null $enum diff --git a/src/Attributes/Tag.php b/src/Attributes/Tag.php index 8ef0ef11..85070a4b 100644 --- a/src/Attributes/Tag.php +++ b/src/Attributes/Tag.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Tag extends \OpenApi\Annotations\Tag +class Tag extends OA\Tag { /** * @param array|null $x diff --git a/src/Attributes/Trace.php b/src/Attributes/Trace.php index aff7fe76..0e04dff0 100644 --- a/src/Attributes/Trace.php +++ b/src/Attributes/Trace.php @@ -6,8 +6,10 @@ namespace OpenApi\Attributes; +use OpenApi\Annotations as OA; + #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Trace extends \OpenApi\Annotations\Trace +class Trace extends OA\Trace { use OperationTrait; } diff --git a/src/Attributes/Webhook.php b/src/Attributes/Webhook.php index f65a33f4..ac35570d 100644 --- a/src/Attributes/Webhook.php +++ b/src/Attributes/Webhook.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Webhook extends \OpenApi\Annotations\Webhook +class Webhook extends OA\Webhook { /** * @param string|class-string|object|null $ref diff --git a/src/Attributes/Xml.php b/src/Attributes/Xml.php index 0f07f657..b171f06d 100644 --- a/src/Attributes/Xml.php +++ b/src/Attributes/Xml.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS)] -class Xml extends \OpenApi\Annotations\Xml +class Xml extends OA\Xml { /** * @param array|null $x diff --git a/src/Attributes/XmlContent.php b/src/Attributes/XmlContent.php index 201277b0..06e7c830 100644 --- a/src/Attributes/XmlContent.php +++ b/src/Attributes/XmlContent.php @@ -7,9 +7,10 @@ namespace OpenApi\Attributes; use OpenApi\Generator; +use OpenApi\Annotations as OA; #[\Attribute(\Attribute::TARGET_CLASS)] -class XmlContent extends \OpenApi\Annotations\XmlContent +class XmlContent extends OA\XmlContent { /** * @param string|non-empty-array|null $type @@ -20,9 +21,9 @@ class XmlContent extends \OpenApi\Annotations\XmlContent * @param int|float $minimum * @param Property[] $properties * @param array|class-string|null $enum - * @param array $allOf - * @param array $anyOf - * @param array $oneOf + * @param array $allOf + * @param array $anyOf + * @param array $oneOf * @param array|null $x * @param Attachable[]|null $attachables */ diff --git a/tests/Annotations/AttributesSyncTest.php b/tests/Annotations/AttributesSyncTest.php index 44132b89..f9da2f40 100644 --- a/tests/Annotations/AttributesSyncTest.php +++ b/tests/Annotations/AttributesSyncTest.php @@ -176,7 +176,7 @@ protected function parameterType(string $parameterName, \ReflectionParameter $pa } if ($var) { - $var = str_replace(['OpenApi\\Annotations\\', 'OpenApi\\Attributes\\'], '', $var); + $var = str_replace(['OpenApi\\Annotations\\', 'OpenApi\\Attributes\\', 'OA'], '', $var); if (false === strpos($var, '<')) { $var = explode('|', $var); sort($var);