Skip to content

Commit 5c97ae8

Browse files
author
Antoine Lelaisant
committed
fix: namespaces
1 parent db18b1e commit 5c97ae8

12 files changed

+30
-30
lines changed

README.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ A PHP implementation of [JSON Schema](http://json-schema.org/). This library all
77
Install the latest version with
88

99
```bash
10-
$ composer require knplabs/php-json-schema
10+
$ composer require Knp/php-json-schema
1111
```
1212

1313
# Basic Usage
1414

15-
A JsonSchema must implements `KnpLabs\JsonSchema\JsonSchemaInterface` (which is basically an alias for `JsonSerializable`).
15+
A JsonSchema must implements `Knp\JsonSchema\JsonSchemaInterface` (which is basically an alias for `JsonSerializable`).
1616

1717
## Default JsonSchema
1818

19-
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.
19+
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.
2020

2121
## Scalars
2222

2323
### `JsonSchema::string()`
2424

2525
```php
26-
use KnpLabs\JsonSchema\JsonSchema;
26+
use Knp\JsonSchema\JsonSchema;
2727

2828
$schema = JsonSchema::create(
2929
'firstName', // The name of the property
@@ -36,7 +36,7 @@ $schema = JsonSchema::create(
3636
### `JsonSchema::text()`
3737

3838
```php
39-
use KnpLabs\JsonSchema\JsonSchema;
39+
use Knp\JsonSchema\JsonSchema;
4040

4141
$schema = JsonSchema::create(
4242
'content', // The name of the property
@@ -49,7 +49,7 @@ $schema = JsonSchema::create(
4949
### `JsonSchema::integer()`
5050

5151
```php
52-
use KnpLabs\JsonSchema\JsonSchema;
52+
use Knp\JsonSchema\JsonSchema;
5353

5454
$schema = JsonSchema::create(
5555
'age', // The name of the property
@@ -62,7 +62,7 @@ $schema = JsonSchema::create(
6262
### `JsonSchema::positiveInteger()`
6363

6464
```php
65-
use KnpLabs\JsonSchema\JsonSchema;
65+
use Knp\JsonSchema\JsonSchema;
6666

6767
$schema = JsonSchema::create(
6868
'age', // The name of the property
@@ -75,7 +75,7 @@ $schema = JsonSchema::create(
7575
### `JsonSchema::number()`
7676

7777
```php
78-
use KnpLabs\JsonSchema\JsonSchema;
78+
use Knp\JsonSchema\JsonSchema;
7979

8080
$schema = JsonSchema::create(
8181
'price', // The name of the property
@@ -88,7 +88,7 @@ $schema = JsonSchema::create(
8888
### `JsonSchema::boolean()`
8989

9090
```php
91-
use KnpLabs\JsonSchema\JsonSchema;
91+
use Knp\JsonSchema\JsonSchema;
9292

9393
$schema = JsonSchema::create(
9494
'isAdult', // The name of the property
@@ -101,7 +101,7 @@ $schema = JsonSchema::create(
101101
### `JsonSchema::date()`
102102

103103
```php
104-
use KnpLabs\JsonSchema\JsonSchema;
104+
use Knp\JsonSchema\JsonSchema;
105105

106106
$schema = JsonSchema::create(
107107
'createdAt', // The name of the property
@@ -114,14 +114,14 @@ $schema = JsonSchema::create(
114114
## Enum
115115

116116
Enum is a special type of scalar which is a list of possible values.
117-
They can be created by extending the `KnpLabs\JsonSchema\EnumSchema`:
117+
They can be created by extending the `Knp\JsonSchema\EnumSchema`:
118118

119119
```php
120120
<?php
121121

122122
namespace Acme;
123123

124-
use KnpLabs\JsonSchema\EnumSchema;
124+
use Knp\JsonSchema\EnumSchema;
125125

126126
class RoleEnum extends EnumSchema
127127
{
@@ -148,14 +148,14 @@ class RoleEnum extends EnumSchema
148148

149149
## Objects
150150

151-
You can create objects schema by extending the `KnpLabs\JsonSchema\ObjectSchema` class:
151+
You can create objects schema by extending the `Knp\JsonSchema\ObjectSchema` class:
152152

153153
```php
154154
<?php
155155

156156
namespace Acme;
157157

158-
use KnpLabs\JsonSchema\ObjectSchema;
158+
use Knp\JsonSchema\ObjectSchema;
159159

160160
class PersonSchema extends ObjectSchema
161161
{
@@ -188,14 +188,14 @@ class PersonSchema extends ObjectSchema
188188

189189
## Collections
190190

191-
You can create collections schema by extending the `KnpLabs\JsonSchema\CollectionSchema` class:
191+
You can create collections schema by extending the `Knp\JsonSchema\CollectionSchema` class:
192192

193193
```php
194194
<?php
195195

196196
namespace Acme;
197197

198-
use KnpLabs\JsonSchema\CollectionSchema;
198+
use Knp\JsonSchema\CollectionSchema;
199199

200200
class PersonCollectionSchema extends CollectionSchema
201201
{

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
"license": "MIT",
66
"autoload": {
77
"psr-4": {
8-
"Knplabs\\JsonSchema\\": "src/"
8+
"Knp\\JsonSchema\\": "src/"
99
}
1010
},
1111
"authors": [
1212
{
13-
"name": "KnpLabs",
13+
"name": "Knp Labs",
1414
"email": "[email protected]"
1515
}
1616
],

src/Collection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace KnpLabs\JsonSchema;
5+
namespace Knp\JsonSchema;
66

77
use Exception;
88

src/CollectionSchema.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace KnpLabs\JsonSchema;
5+
namespace Knp\JsonSchema;
66

77
/**
88
* @template I

src/EnumSchema.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace KnpLabs\JsonSchema;
5+
namespace Knp\JsonSchema;
66

77
/**
88
* @template E

src/JsonSchema.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace KnpLabs\JsonSchema;
5+
namespace Knp\JsonSchema;
66

77
/**
88
* @template T of mixed

src/JsonSchemaInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace KnpLabs\JsonSchema;
5+
namespace Knp\JsonSchema;
66

77
use JsonSerializable;
88

src/ObjectSchema.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace KnpLabs\JsonSchema;
5+
namespace Knp\JsonSchema;
66

77
/**
88
* @template T of array<string, mixed>

src/Scalar/UuidSchema.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
declare(strict_types=1);
44

5-
namespace KnpLabs\JsonSchema\Scalar;
5+
namespace Knp\JsonSchema\Scalar;
66

7-
use KnpLabs\JsonSchema\JsonSchema;
7+
use Knp\JsonSchema\JsonSchema;
88

99
/**
1010
* @extends JsonSchema<string>

src/Validator.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
declare(strict_types=1);
44

5-
namespace KnpLabs\JsonSchema;
5+
namespace Knp\JsonSchema;
66

7-
use KnpLabs\JsonSchema\Validator\Errors;
7+
use Knp\JsonSchema\Validator\Errors;
88

99
interface Validator
1010
{

src/Validator/Error.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace KnpLabs\JsonSchema\Validator;
5+
namespace Knp\JsonSchema\Validator;
66

77
final class Error
88
{

src/Validator/Errors.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace KnpLabs\JsonSchema\Validator;
5+
namespace Knp\JsonSchema\Validator;
66

77
use ArrayIterator;
88
use Countable;

0 commit comments

Comments
 (0)