From 2d7aa96f78af9234bef1a523a5e4585ffad786bb Mon Sep 17 00:00:00 2001 From: Antoine Lelaisant Date: Mon, 31 Oct 2022 09:07:59 +0100 Subject: [PATCH] chore: update the root namespace from Knp to KnpLabs --- README.md | 39 ++++++++++++++++++++++--------------- composer.json | 2 +- src/Collection.php | 2 +- src/CollectionSchema.php | 2 +- src/EnumSchema.php | 2 +- src/JsonSchema.php | 4 +--- src/JsonSchemaInterface.php | 3 +-- src/ObjectSchema.php | 2 +- src/Scalar/UuidSchema.php | 6 +++--- src/Validator.php | 4 ++-- src/Validator/Error.php | 2 +- src/Validator/Errors.php | 2 +- 12 files changed, 37 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 4c2eb24..b9fe052 100644 --- a/README.md +++ b/README.md @@ -7,23 +7,23 @@ A PHP implementation of [JSON Schema](http://json-schema.org/). This library all Install the latest version with ```bash -$ composer require Knp/php-json-schema +$ composer require knplabs/php-json-schema ``` # Basic Usage -A JsonSchema must implements `Knp\JsonSchema\JsonSchemaInterface` (which is basically an alias for `JsonSerializable`). +A JsonSchema must implements `KnpLabs\JsonSchema\JsonSchemaInterface` (which also extends `JsonSerializable`). ## Default JsonSchema -There is already a default implementation of `JsonSchemaInterface` called `Knp\JsonSchema\JsonSchema` which is an abstract class. This class provides some static methods to create some common JSON Schema scalars or objects. +There is already a default implementation of `JsonSchemaInterface` called `KnpLabs\JsonSchema\JsonSchema` which is an abstract class. This class provides some static methods to create some common JSON Schema scalars or objects. ## Scalars ### `JsonSchema::string()` ```php -use Knp\JsonSchema\JsonSchema; +use KnpLabs\JsonSchema\JsonSchema; $schema = JsonSchema::create( 'firstName', // The name of the property @@ -36,7 +36,7 @@ $schema = JsonSchema::create( ### `JsonSchema::text()` ```php -use Knp\JsonSchema\JsonSchema; +use KnpLabs\JsonSchema\JsonSchema; $schema = JsonSchema::create( 'content', // The name of the property @@ -49,7 +49,7 @@ $schema = JsonSchema::create( ### `JsonSchema::integer()` ```php -use Knp\JsonSchema\JsonSchema; +use KnpLabs\JsonSchema\JsonSchema; $schema = JsonSchema::create( 'age', // The name of the property @@ -62,7 +62,7 @@ $schema = JsonSchema::create( ### `JsonSchema::positiveInteger()` ```php -use Knp\JsonSchema\JsonSchema; +use KnpLabs\JsonSchema\JsonSchema; $schema = JsonSchema::create( 'age', // The name of the property @@ -75,7 +75,7 @@ $schema = JsonSchema::create( ### `JsonSchema::number()` ```php -use Knp\JsonSchema\JsonSchema; +use KnpLabs\JsonSchema\JsonSchema; $schema = JsonSchema::create( 'price', // The name of the property @@ -88,7 +88,7 @@ $schema = JsonSchema::create( ### `JsonSchema::boolean()` ```php -use Knp\JsonSchema\JsonSchema; +use KnpLabs\JsonSchema\JsonSchema; $schema = JsonSchema::create( 'isAdult', // The name of the property @@ -101,7 +101,7 @@ $schema = JsonSchema::create( ### `JsonSchema::date()` ```php -use Knp\JsonSchema\JsonSchema; +use KnpLabs\JsonSchema\JsonSchema; $schema = JsonSchema::create( 'createdAt', // The name of the property @@ -114,14 +114,14 @@ $schema = JsonSchema::create( ## Enum Enum is a special type of scalar which is a list of possible values. -They can be created by extending the `Knp\JsonSchema\EnumSchema`: +They can be created by extending the `KnpLabs\JsonSchema\EnumSchema`: ```php + */ class PersonSchema extends ObjectSchema { public function __construct() @@ -188,14 +195,14 @@ class PersonSchema extends ObjectSchema ## Collections -You can create collections schema by extending the `Knp\JsonSchema\CollectionSchema` class: +You can create collections schema by extending the `KnpLabs\JsonSchema\CollectionSchema` class: ```php diff --git a/src/Validator.php b/src/Validator.php index 6f364df..4d1fa69 100644 --- a/src/Validator.php +++ b/src/Validator.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Knp\JsonSchema; +namespace KnpLabs\JsonSchema; -use Knp\JsonSchema\Validator\Errors; +use KnpLabs\JsonSchema\Validator\Errors; interface Validator { diff --git a/src/Validator/Error.php b/src/Validator/Error.php index 8b18d2e..7c978e1 100644 --- a/src/Validator/Error.php +++ b/src/Validator/Error.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Knp\JsonSchema\Validator; +namespace KnpLabs\JsonSchema\Validator; final class Error { diff --git a/src/Validator/Errors.php b/src/Validator/Errors.php index 58608d7..c53b6a4 100644 --- a/src/Validator/Errors.php +++ b/src/Validator/Errors.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Knp\JsonSchema\Validator; +namespace KnpLabs\JsonSchema\Validator; use ArrayIterator; use Countable;