From 3687a6bd7ef4a023b9a66572abda79829c13a2e7 Mon Sep 17 00:00:00 2001 From: chris cnizzardini Date: Fri, 18 Dec 2020 21:15:39 -0500 Subject: [PATCH] Code cleanup from static analyzers and mixerapi/core version fix --- composer.json | 2 +- src/Lib/Model/ModelScanner.php | 2 -- src/Lib/OpenApi/Schema.php | 8 +++++--- src/Lib/Schema/SchemaFactory.php | 1 - src/Lib/Swagger.php | 1 + 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index b975f5bf..fabcc575 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "phpdocumentor/reflection-docblock": "^5.1", "doctrine/annotations": "^1.10", "thecodingmachine/class-explorer": "^1.1", - "mixerapi/core": "~1.0" + "mixerapi/core": "^0.2" }, "suggest": { "friendsofcake/search": "Easy model searching with @SwagSearch", diff --git a/src/Lib/Model/ModelScanner.php b/src/Lib/Model/ModelScanner.php index b55090cf..e5dc183b 100644 --- a/src/Lib/Model/ModelScanner.php +++ b/src/Lib/Model/ModelScanner.php @@ -10,12 +10,10 @@ use MixerApi\Core\Model\Model; use MixerApi\Core\Model\ModelFactory; use MixerApi\Core\Utility\NamespaceUtility; -use SwaggerBake\Lib\Annotation\SwagEntity; use SwaggerBake\Lib\Configuration; use SwaggerBake\Lib\Exception\SwaggerBakeRunTimeException; use SwaggerBake\Lib\Route\RouteDecorator; use SwaggerBake\Lib\Route\RouteScanner; -use SwaggerBake\Lib\Utility\AnnotationUtility; /** * Finds all Entities associated with RESTful routes based on userland configurations diff --git a/src/Lib/OpenApi/Schema.php b/src/Lib/OpenApi/Schema.php index 77846c13..843ad59a 100644 --- a/src/Lib/OpenApi/Schema.php +++ b/src/Lib/OpenApi/Schema.php @@ -10,6 +10,7 @@ * * @package SwaggerBake\Lib\OpenApi * @see https://swagger.io/docs/specification/data-models/ + * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) */ class Schema implements JsonSerializable { @@ -571,12 +572,13 @@ public function isVisible(): bool } /** - * @param bool $isVisible - * @return Schema + * @param bool $isVisible indicates visibility + * @return $this */ - public function setIsVisible(bool $isVisible): Schema + public function setIsVisible(bool $isVisible) { $this->isVisible = $isVisible; + return $this; } } diff --git a/src/Lib/Schema/SchemaFactory.php b/src/Lib/Schema/SchemaFactory.php index 77aeb912..d60d6731 100644 --- a/src/Lib/Schema/SchemaFactory.php +++ b/src/Lib/Schema/SchemaFactory.php @@ -58,7 +58,6 @@ class SchemaFactory public function create(ModelDecorator $modelDecorator, int $propertyType = 6): Schema { $model = $modelDecorator->getModel(); - /** @var SwagEntity $swagEntity */ $swagEntity = $this->getSwagEntityAnnotation($model->getEntity()); $this->validator = $this->getValidator($model); diff --git a/src/Lib/Swagger.php b/src/Lib/Swagger.php index 17e4db43..8bf612fe 100644 --- a/src/Lib/Swagger.php +++ b/src/Lib/Swagger.php @@ -22,6 +22,7 @@ * Class Swagger * * @package SwaggerBake\Lib + * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) */ class Swagger {