diff --git a/src/Analysis.php b/src/Analysis.php index 50bd00e94..8451069d4 100644 --- a/src/Analysis.php +++ b/src/Analysis.php @@ -7,7 +7,6 @@ namespace OpenApi; use OpenApi\Annotations as OA; -use OpenApi\Processors\ProcessorInterface; /** * Result of the analyser. @@ -405,11 +404,11 @@ public function split() /** * Apply the processor(s). * - * @param callable|ProcessorInterface|array $processors One or more processors + * @param callable|array $processors One or more processors */ public function process($processors = null): void { - if (is_array($processors) === false && is_callable($processors) || $processors instanceof ProcessorInterface) { + if (false === is_array($processors) && is_callable($processors)) { $processors = [$processors]; } diff --git a/src/Processors/AugmentParameters.php b/src/Processors/AugmentParameters.php index fbe0f5792..e70a81f2a 100644 --- a/src/Processors/AugmentParameters.php +++ b/src/Processors/AugmentParameters.php @@ -14,7 +14,7 @@ /** * Augments shared and operations parameters from docblock comments. */ -class AugmentParameters implements ProcessorInterface +class AugmentParameters { use DocblockTrait; diff --git a/src/Processors/AugmentProperties.php b/src/Processors/AugmentProperties.php index 139168e28..01052183d 100644 --- a/src/Processors/AugmentProperties.php +++ b/src/Processors/AugmentProperties.php @@ -14,7 +14,7 @@ /** * Use the property context to extract useful information and inject that into the annotation. */ -class AugmentProperties implements ProcessorInterface +class AugmentProperties { use Concerns\DocblockTrait; use Concerns\RefTrait; diff --git a/src/Processors/AugmentRefs.php b/src/Processors/AugmentRefs.php index b120d2954..06c82905f 100644 --- a/src/Processors/AugmentRefs.php +++ b/src/Processors/AugmentRefs.php @@ -10,7 +10,7 @@ use OpenApi\Annotations as OA; use OpenApi\Generator; -class AugmentRefs implements ProcessorInterface +class AugmentRefs { use Concerns\RefTrait; diff --git a/src/Processors/AugmentRequestBody.php b/src/Processors/AugmentRequestBody.php index 77733a755..132c316d1 100644 --- a/src/Processors/AugmentRequestBody.php +++ b/src/Processors/AugmentRequestBody.php @@ -13,7 +13,7 @@ /** * Use the RequestBody context to extract useful information and inject that into the annotation. */ -class AugmentRequestBody implements ProcessorInterface +class AugmentRequestBody { public function __invoke(Analysis $analysis) { diff --git a/src/Processors/AugmentSchemas.php b/src/Processors/AugmentSchemas.php index ebc4d0b7e..97d1b2af3 100644 --- a/src/Processors/AugmentSchemas.php +++ b/src/Processors/AugmentSchemas.php @@ -16,7 +16,7 @@ * * Merges properties. */ -class AugmentSchemas implements ProcessorInterface +class AugmentSchemas { public function __invoke(Analysis $analysis) { diff --git a/src/Processors/AugmentTags.php b/src/Processors/AugmentTags.php index 4a450b9c2..9093a1ae7 100644 --- a/src/Processors/AugmentTags.php +++ b/src/Processors/AugmentTags.php @@ -13,7 +13,7 @@ /** * Ensures that all tags used on operations also exist in the global tags list. */ -class AugmentTags implements ProcessorInterface +class AugmentTags { /** @var array */ protected array $whitelist = []; diff --git a/src/Processors/BuildPaths.php b/src/Processors/BuildPaths.php index 6d6d6ce45..84ed1006d 100644 --- a/src/Processors/BuildPaths.php +++ b/src/Processors/BuildPaths.php @@ -14,7 +14,7 @@ /** * Build the openapi->paths using the detected `@OA\PathItem` and `@OA\Operation` (`@OA\Get`, `@OA\Post`, etc). */ -class BuildPaths implements ProcessorInterface +class BuildPaths { public function __invoke(Analysis $analysis) { diff --git a/src/Processors/CleanUnmerged.php b/src/Processors/CleanUnmerged.php index 6b3e2147d..5a694f2de 100644 --- a/src/Processors/CleanUnmerged.php +++ b/src/Processors/CleanUnmerged.php @@ -9,7 +9,7 @@ use OpenApi\Analysis; use OpenApi\Annotations as OA; -class CleanUnmerged implements ProcessorInterface +class CleanUnmerged { public function __invoke(Analysis $analysis) { diff --git a/src/Processors/CleanUnusedComponents.php b/src/Processors/CleanUnusedComponents.php index ecd4b0c62..035e1f9b7 100644 --- a/src/Processors/CleanUnusedComponents.php +++ b/src/Processors/CleanUnusedComponents.php @@ -13,7 +13,7 @@ /** * Tracks the use of all Components and removed unused schemas. */ -class CleanUnusedComponents implements ProcessorInterface +class CleanUnusedComponents { use Concerns\AnnotationTrait; diff --git a/src/Processors/DocBlockDescriptions.php b/src/Processors/DocBlockDescriptions.php index 59070fd34..974bc242d 100644 --- a/src/Processors/DocBlockDescriptions.php +++ b/src/Processors/DocBlockDescriptions.php @@ -16,7 +16,7 @@ * * Use `null`, for example: `@Annotation(description=null)`, if you don't want the annotation to have a description. */ -class DocBlockDescriptions implements ProcessorInterface +class DocBlockDescriptions { use Concerns\DocblockTrait; diff --git a/src/Processors/ExpandClasses.php b/src/Processors/ExpandClasses.php index 9ba659736..acee10541 100644 --- a/src/Processors/ExpandClasses.php +++ b/src/Processors/ExpandClasses.php @@ -17,7 +17,7 @@ * - else * => merge ancestor properties into the schema. */ -class ExpandClasses implements ProcessorInterface +class ExpandClasses { use Concerns\MergePropertiesTrait; diff --git a/src/Processors/ExpandEnums.php b/src/Processors/ExpandEnums.php index c3ce831e7..8e712bc54 100644 --- a/src/Processors/ExpandEnums.php +++ b/src/Processors/ExpandEnums.php @@ -16,7 +16,7 @@ * * Determines `schema`, `enum` and `type`. */ -class ExpandEnums implements ProcessorInterface +class ExpandEnums { use Concerns\TypesTrait; diff --git a/src/Processors/ExpandTraits.php b/src/Processors/ExpandTraits.php index 5cd7e2a45..01090d119 100644 --- a/src/Processors/ExpandTraits.php +++ b/src/Processors/ExpandTraits.php @@ -15,7 +15,7 @@ * - merge trait annotations/methods/properties into the schema if the trait does not have a schema itself * - inherit from the trait if it has a schema (allOf). */ -class ExpandTraits implements ProcessorInterface +class ExpandTraits { use Concerns\MergePropertiesTrait; diff --git a/src/Processors/MergeIntoComponents.php b/src/Processors/MergeIntoComponents.php index 8a024f923..03dbaab9c 100644 --- a/src/Processors/MergeIntoComponents.php +++ b/src/Processors/MergeIntoComponents.php @@ -14,7 +14,7 @@ /** * Merge reusable annotation into @OA\Schemas. */ -class MergeIntoComponents implements ProcessorInterface +class MergeIntoComponents { public function __invoke(Analysis $analysis) { diff --git a/src/Processors/MergeIntoOpenApi.php b/src/Processors/MergeIntoOpenApi.php index 5611ba4f7..597cb14e7 100644 --- a/src/Processors/MergeIntoOpenApi.php +++ b/src/Processors/MergeIntoOpenApi.php @@ -14,7 +14,7 @@ /** * Merge all @OA\OpenApi annotations into one. */ -class MergeIntoOpenApi implements ProcessorInterface +class MergeIntoOpenApi { public function __invoke(Analysis $analysis) { diff --git a/src/Processors/MergeJsonContent.php b/src/Processors/MergeJsonContent.php index c52c1bfd5..ab8d804c3 100644 --- a/src/Processors/MergeJsonContent.php +++ b/src/Processors/MergeJsonContent.php @@ -14,7 +14,7 @@ /** * Split JsonContent into Schema and MediaType. */ -class MergeJsonContent implements ProcessorInterface +class MergeJsonContent { public function __invoke(Analysis $analysis) { diff --git a/src/Processors/MergeXmlContent.php b/src/Processors/MergeXmlContent.php index 1f491889e..45590dccd 100644 --- a/src/Processors/MergeXmlContent.php +++ b/src/Processors/MergeXmlContent.php @@ -14,7 +14,7 @@ /** * Split XmlContent into Schema and MediaType. */ -class MergeXmlContent implements ProcessorInterface +class MergeXmlContent { public function __invoke(Analysis $analysis) { diff --git a/src/Processors/OperationId.php b/src/Processors/OperationId.php index 84d7ac60b..bb874c27d 100644 --- a/src/Processors/OperationId.php +++ b/src/Processors/OperationId.php @@ -13,7 +13,7 @@ /** * Generate the OperationId based on the context of the OpenApi annotation. */ -class OperationId implements ProcessorInterface +class OperationId { protected bool $hash; diff --git a/src/Processors/PathFilter.php b/src/Processors/PathFilter.php index 079a098db..58716071e 100644 --- a/src/Processors/PathFilter.php +++ b/src/Processors/PathFilter.php @@ -16,7 +16,7 @@ * If no `tags` or `paths` filters are set, no filtering is performed. * All filter (regular) expressions must be enclosed within delimiter characters as they are used as-is. */ -class PathFilter implements ProcessorInterface +class PathFilter { use AnnotationTrait; diff --git a/src/Processors/ProcessorInterface.php b/src/Processors/ProcessorInterface.php deleted file mode 100644 index 67e8e820c..000000000 --- a/src/Processors/ProcessorInterface.php +++ /dev/null @@ -1,14 +0,0 @@ -