From 806297ce1569b5e0560549c1044904417178dcb9 Mon Sep 17 00:00:00 2001 From: Antoine Lelaisant Date: Mon, 31 Oct 2022 11:59:35 +0100 Subject: [PATCH] chore: update the root namespace from Knp to KnpLabs --- composer.json | 4 ++-- config/services.php | 10 +++++----- src/DependencyInjection/JsonSchemaExtension.php | 4 ++-- src/Exception/JsonSchemaException.php | 4 ++-- src/JsonSchemaBundle.php | 4 ++-- src/OpenApi/Annotation/JsonSchema.php | 2 +- src/OpenApi/Attributes/JsonSchema.php | 3 +-- src/RequestHandler.php | 10 +++++----- src/Validator/SwaggestValidator.php | 10 +++++----- 9 files changed, 25 insertions(+), 26 deletions(-) diff --git a/composer.json b/composer.json index 81c7e48..9c94b94 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "minimum-stability": "stable", "autoload": { "psr-4": { - "Knp\\JsonSchemaBundle\\": "src/" + "KnpLabs\\JsonSchemaBundle\\": "src/" } }, "authors": [ @@ -17,7 +17,7 @@ ], "require": { "php": ">=8.0", - "knplabs/php-json-schema": ">=0.0.4", + "knplabs/php-json-schema": "~0.1.0", "zircote/swagger-php": ">=4.4", "symfony/http-kernel": ">=6.0", "symfony/dependency-injection": ">=6.0", diff --git a/config/services.php b/config/services.php index 103f462..06e3de7 100644 --- a/config/services.php +++ b/config/services.php @@ -2,10 +2,10 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; -use Knp\JsonSchema\Collection; -use Knp\JsonSchema\JsonSchemaInterface; -use Knp\JsonSchemaBundle\RequestHandler; -use Knp\JsonSchemaBundle\Validator\SwaggestValidator; +use KnpLabs\JsonSchema\Collection; +use KnpLabs\JsonSchema\JsonSchemaInterface; +use KnpLabs\JsonSchemaBundle\RequestHandler; +use KnpLabs\JsonSchemaBundle\Validator\SwaggestValidator; return function(ContainerConfigurator $configurator) { $services = $configurator->services() @@ -19,7 +19,7 @@ ; $services->set(SwaggestValidator::class); - $services->alias('Knp\JsonSchema\Validator', SwaggestValidator::class); + $services->alias('KnpLabs\JsonSchema\Validator', SwaggestValidator::class); $services->set(Collection::class) ->arg('$schemas', tagged_iterator('knp.json_schema')) diff --git a/src/DependencyInjection/JsonSchemaExtension.php b/src/DependencyInjection/JsonSchemaExtension.php index 081ef11..0ababdd 100644 --- a/src/DependencyInjection/JsonSchemaExtension.php +++ b/src/DependencyInjection/JsonSchemaExtension.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Knp\JsonSchemaBundle\DependencyInjection; +namespace KnpLabs\JsonSchemaBundle\DependencyInjection; -use Knp\JsonSchema\JsonSchemaInterface; +use KnpLabs\JsonSchema\JsonSchemaInterface; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\Extension; diff --git a/src/Exception/JsonSchemaException.php b/src/Exception/JsonSchemaException.php index 7fd3b8a..e1f94f5 100644 --- a/src/Exception/JsonSchemaException.php +++ b/src/Exception/JsonSchemaException.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Knp\JsonSchemaBundle\Exception; +namespace KnpLabs\JsonSchemaBundle\Exception; -use Knp\JsonSchema\Validator\Errors; +use KnpLabs\JsonSchema\Validator\Errors; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; class JsonSchemaException extends BadRequestHttpException diff --git a/src/JsonSchemaBundle.php b/src/JsonSchemaBundle.php index 1587002..6274dff 100644 --- a/src/JsonSchemaBundle.php +++ b/src/JsonSchemaBundle.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Knp\JsonSchemaBundle; +namespace KnpLabs\JsonSchemaBundle; -use Knp\JsonSchemaBundle\DependencyInjection\JsonSchemaExtension; +use KnpLabs\JsonSchemaBundle\DependencyInjection\JsonSchemaExtension; use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; use Symfony\Component\HttpKernel\Bundle\AbstractBundle; diff --git a/src/OpenApi/Annotation/JsonSchema.php b/src/OpenApi/Annotation/JsonSchema.php index 305a5ef..00ec49f 100644 --- a/src/OpenApi/Annotation/JsonSchema.php +++ b/src/OpenApi/Annotation/JsonSchema.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Knp\JsonSchemaBundle\OpenApi\Annotation; +namespace KnpLabs\JsonSchemaBundle\OpenApi\Annotation; use OpenApi\Annotations\Property; use OpenApi\Annotations\Schema; diff --git a/src/OpenApi/Attributes/JsonSchema.php b/src/OpenApi/Attributes/JsonSchema.php index dbb02f2..12cb182 100644 --- a/src/OpenApi/Attributes/JsonSchema.php +++ b/src/OpenApi/Attributes/JsonSchema.php @@ -2,11 +2,10 @@ declare(strict_types=1); -namespace Knp\JsonSchemaBundle\OpenApi\Attributes; +namespace KnpLabs\JsonSchemaBundle\OpenApi\Attributes; use OpenApi\Attributes\Property; use OpenApi\Attributes\Schema; -use OpenApi\Generator; class JsonSchema extends Schema { diff --git a/src/RequestHandler.php b/src/RequestHandler.php index 79a434c..47c2083 100644 --- a/src/RequestHandler.php +++ b/src/RequestHandler.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Knp\JsonSchemaBundle; +namespace KnpLabs\JsonSchemaBundle; -use Knp\JsonSchema\Collection; -use Knp\JsonSchema\JsonSchemaInterface; -use Knp\JsonSchema\Validator; -use Knp\JsonSchemaBundle\Exception\JsonSchemaException; +use KnpLabs\JsonSchema\Collection; +use KnpLabs\JsonSchema\JsonSchemaInterface; +use KnpLabs\JsonSchema\Validator; +use KnpLabs\JsonSchemaBundle\Exception\JsonSchemaException; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\UnsupportedMediaTypeHttpException; diff --git a/src/Validator/SwaggestValidator.php b/src/Validator/SwaggestValidator.php index 12cbe50..888bdf6 100644 --- a/src/Validator/SwaggestValidator.php +++ b/src/Validator/SwaggestValidator.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Knp\JsonSchemaBundle\Validator; +namespace KnpLabs\JsonSchemaBundle\Validator; -use Knp\JsonSchema\JsonSchemaInterface; -use Knp\JsonSchema\Validator; -use Knp\JsonSchema\Validator\Errors; -use Knp\JsonSchema\Validator\Error as KnpJsonSchemaError; +use KnpLabs\JsonSchema\JsonSchemaInterface; +use KnpLabs\JsonSchema\Validator; +use KnpLabs\JsonSchema\Validator\Errors; +use KnpLabs\JsonSchema\Validator\Error as KnpJsonSchemaError; use Swaggest\JsonSchema\Exception\Error; use Swaggest\JsonSchema\Exception\LogicException; use Swaggest\JsonSchema\InvalidValue;