Skip to content

Commit 9420ae5

Browse files
committed
Remove deprecations in exceptions
1 parent 2b6a820 commit 9420ae5

10 files changed

+20
-15
lines changed

src/Exception/DuplicateSchemaException.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
namespace Opis\JsonSchema\Exception;
1919

20-
use stdClass, Throwable;
20+
use stdClass;
21+
use Throwable;
2122

2223
class DuplicateSchemaException extends AbstractSchemaException
2324
{
@@ -38,7 +39,7 @@ class DuplicateSchemaException extends AbstractSchemaException
3839
* @param array $container
3940
* @param Throwable|null $previous
4041
*/
41-
public function __construct(string $id, stdClass $schema, array $container = [], Throwable $previous = null)
42+
public function __construct(string $id, stdClass $schema, array $container = [], ?Throwable $previous = null)
4243
{
4344
$this->id = $id;
4445
$this->schema = $schema;

src/Exception/FilterNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class FilterNotFoundException extends AbstractSchemaException
3434
* @param string $filter
3535
* @param Throwable|null $previous
3636
*/
37-
public function __construct(string $type, string $filter, Throwable $previous = null)
37+
public function __construct(string $type, string $filter, ?Throwable $previous = null)
3838
{
3939
$this->type = $type;
4040
$this->filter = $filter;

src/Exception/InvalidJsonPointerException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class InvalidJsonPointerException extends AbstractSchemaException
3030
* @param string $pointer
3131
* @param Throwable|null $previous
3232
*/
33-
public function __construct(string $pointer, Throwable $previous = null)
33+
public function __construct(string $pointer, ?Throwable $previous = null)
3434
{
3535
$this->pointer = $pointer;
3636
parent::__construct("Invalid JSON pointer: $pointer", 0, $previous);

src/Exception/InvalidSchemaDraftException.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
namespace Opis\JsonSchema\Exception;
1919

20-
use stdClass, Throwable;
20+
use stdClass;
21+
use Throwable;
2122

2223
class InvalidSchemaDraftException extends AbstractSchemaException
2324
{
@@ -30,7 +31,7 @@ class InvalidSchemaDraftException extends AbstractSchemaException
3031
* @param stdClass $schema
3132
* @param Throwable|null $previous
3233
*/
33-
public function __construct(stdClass $schema, Throwable $previous = null)
34+
public function __construct(stdClass $schema, ?Throwable $previous = null)
3435
{
3536
$this->schema = $schema;
3637
parent::__construct("Invalid '\$schema' property", 0, $previous);

src/Exception/InvalidSchemaException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class InvalidSchemaException extends AbstractSchemaException
3030
* @param $schema
3131
* @param Throwable|null $previous
3232
*/
33-
public function __construct($schema, Throwable $previous = null)
33+
public function __construct($schema, ?Throwable $previous = null)
3434
{
3535
$this->schema = $schema;
3636
$type = is_object($schema) ? get_class($schema) : gettype($schema);

src/Exception/InvalidSchemaIdException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class InvalidSchemaIdException extends AbstractSchemaException
3030
* @param string $id
3131
* @param Throwable|null $previous
3232
*/
33-
public function __construct(string $id, Throwable $previous = null)
33+
public function __construct(string $id, ?Throwable $previous = null)
3434
{
3535
$this->id = $id;
3636
parent::__construct("Invalid id '{$id}'", 0, $previous);

src/Exception/SchemaDraftNotSupportedException.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
namespace Opis\JsonSchema\Exception;
1919

20-
use stdClass, Throwable;
20+
use stdClass;
21+
use Throwable;
2122

2223
class SchemaDraftNotSupportedException extends AbstractSchemaException
2324
{
@@ -34,7 +35,7 @@ class SchemaDraftNotSupportedException extends AbstractSchemaException
3435
* @param string $draft
3536
* @param Throwable|null $previous
3637
*/
37-
public function __construct(stdClass $schema, string $draft, Throwable $previous = null)
38+
public function __construct(stdClass $schema, string $draft, ?Throwable $previous = null)
3839
{
3940
$this->schema = $schema;
4041
$this->draft = $draft;

src/Exception/SchemaKeywordException.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
namespace Opis\JsonSchema\Exception;
1919

20-
use stdClass, Throwable;
20+
use stdClass;
21+
use Throwable;
2122

2223
class SchemaKeywordException extends AbstractSchemaException
2324
{
@@ -39,7 +40,7 @@ class SchemaKeywordException extends AbstractSchemaException
3940
* @param string $message
4041
* @param Throwable|null $previous
4142
*/
42-
public function __construct(stdClass $schema, string $keyword, $value, string $message, Throwable $previous = null)
43+
public function __construct(stdClass $schema, string $keyword, $value, string $message, ?Throwable $previous = null)
4344
{
4445
$this->schema = $schema;
4546
$this->keyword = $keyword;

src/Exception/SchemaNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class SchemaNotFoundException extends AbstractSchemaException
3030
* @param string $id
3131
* @param Throwable|null $previous
3232
*/
33-
public function __construct(string $id, Throwable $previous = null)
33+
public function __construct(string $id, ?Throwable $previous = null)
3434
{
3535
$this->id = $id;
3636
parent::__construct("Schema '{$id}' was not found or could not be loaded", 0, $previous);

src/Exception/UnknownMediaTypeException.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
namespace Opis\JsonSchema\Exception;
1919

20-
use stdClass, Throwable;
20+
use stdClass;
21+
use Throwable;
2122

2223
class UnknownMediaTypeException extends AbstractSchemaException
2324
{
@@ -31,7 +32,7 @@ class UnknownMediaTypeException extends AbstractSchemaException
3132
/**
3233
* @inheritDoc
3334
*/
34-
public function __construct(stdClass $schema, string $media, Throwable $previous = null)
35+
public function __construct(stdClass $schema, string $media, ?Throwable $previous = null)
3536
{
3637
$this->schema = $schema;
3738
$this->media = $media;

0 commit comments

Comments
 (0)