diff --git a/composer.json b/composer.json index 742a1b3..ceb3157 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,7 @@ "scripts": { "test": [ "phpcs", - "XDEBUG_MODE=coverage phpunit --coverage-text" + "XDEBUG_MODE=coverage phpunit --coverage-text --colors=always" ], "build": [ "phpdoc -d src/ -t phpdoc/", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 3c048ca..e90a9d4 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,12 +1,12 @@ - + ./src - + ./tests/ diff --git a/src/Annotation/OpenApi/Schema.php b/src/Annotation/OpenApi/Schema.php index fa6e107..ac93b99 100644 --- a/src/Annotation/OpenApi/Schema.php +++ b/src/Annotation/OpenApi/Schema.php @@ -29,8 +29,10 @@ * * @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schema-object * @link https://json-schema.org/draft/2019-09/json-schema-validation.html + * + * @final */ -final class Schema extends AbstractAnnotation implements SchemaInterface, ComponentInterface +class Schema extends AbstractAnnotation implements SchemaInterface, ComponentInterface { /** diff --git a/src/Annotation/OpenApi/SchemaArray.php b/src/Annotation/OpenApi/SchemaArray.php new file mode 100644 index 0000000..4b15b3e --- /dev/null +++ b/src/Annotation/OpenApi/SchemaArray.php @@ -0,0 +1,31 @@ + + * @copyright Copyright (c) 2019, Anatoly Fenric + * @license https://github.com/sunrise-php/http-router-openapi/blob/master/LICENSE + * @link https://github.com/sunrise-php/http-router-openapi + */ + +namespace Sunrise\Http\Router\OpenApi\Annotation\OpenApi; + +/** + * @Annotation + * + * @Target({"ALL"}) + */ +final class SchemaArray extends Schema +{ + + /** + * @var \Sunrise\Http\Router\OpenApi\Annotation\OpenApi\SchemaInterface + */ + public $items; + + /** + * @var string + */ + public $type = 'array'; +} diff --git a/src/Annotation/OpenApi/SchemaObject.php b/src/Annotation/OpenApi/SchemaObject.php new file mode 100644 index 0000000..4b37264 --- /dev/null +++ b/src/Annotation/OpenApi/SchemaObject.php @@ -0,0 +1,31 @@ + + * @copyright Copyright (c) 2019, Anatoly Fenric + * @license https://github.com/sunrise-php/http-router-openapi/blob/master/LICENSE + * @link https://github.com/sunrise-php/http-router-openapi + */ + +namespace Sunrise\Http\Router\OpenApi\Annotation\OpenApi; + +/** + * @Annotation + * + * @Target({"ALL"}) + */ +final class SchemaObject extends Schema +{ + + /** + * @var array<\Sunrise\Http\Router\OpenApi\Annotation\OpenApi\SchemaInterface> + */ + public $properties; + + /** + * @var string + */ + public $type = 'object'; +}