Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Exceptions/ValidationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ValidationException extends Exception
{
protected $errors;

public function __construct(array $errors, $message = '', $code = 0, Throwable $previous = null)
public function __construct(array $errors, $message = '', $code = 0, ?Throwable $previous = null)
{
parent::__construct($message, $code, $previous);

Expand Down
6 changes: 3 additions & 3 deletions src/Objects/BaseObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ abstract class BaseObject implements JsonSerializable
*
* @param string|null $objectId
*/
public function __construct(string $objectId = null)
public function __construct(?string $objectId = null)
{
$this->objectId = $objectId;
$this->extensions = new Extensions();
Expand All @@ -45,7 +45,7 @@ public function __construct(string $objectId = null)
* @param string|null $objectId
* @return static
*/
public static function create(string $objectId = null): self
public static function create(?string $objectId = null): self
{
return new static($objectId);
}
Expand All @@ -55,7 +55,7 @@ public static function create(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function ref(string $ref, string $objectId = null): self
public static function ref(string $ref, ?string $objectId = null): self
{
$instance = new static($objectId);

Expand Down
16 changes: 8 additions & 8 deletions src/Objects/MediaType.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class MediaType extends BaseObject
* @param string|null $objectId
* @return static
*/
public static function json(string $objectId = null): self
public static function json(?string $objectId = null): self
{
return static::create($objectId)
->mediaType(static::MEDIA_TYPE_APPLICATION_JSON);
Expand All @@ -64,7 +64,7 @@ public static function json(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function pdf(string $objectId = null): self
public static function pdf(?string $objectId = null): self
{
return static::create($objectId)
->mediaType(static::MEDIA_TYPE_APPLICATION_PDF);
Expand All @@ -74,7 +74,7 @@ public static function pdf(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function jpeg(string $objectId = null): self
public static function jpeg(?string $objectId = null): self
{
return static::create($objectId)
->mediaType(static::MEDIA_TYPE_IMAGE_JPEG);
Expand All @@ -84,7 +84,7 @@ public static function jpeg(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function png(string $objectId = null): self
public static function png(?string $objectId = null): self
{
return static::create($objectId)
->mediaType(static::MEDIA_TYPE_IMAGE_PNG);
Expand All @@ -94,7 +94,7 @@ public static function png(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function calendar(string $objectId = null): self
public static function calendar(?string $objectId = null): self
{
return static::create($objectId)
->mediaType(static::MEDIA_TYPE_TEXT_CALENDAR);
Expand All @@ -104,7 +104,7 @@ public static function calendar(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function plainText(string $objectId = null): self
public static function plainText(?string $objectId = null): self
{
return static::create($objectId)
->mediaType(static::MEDIA_TYPE_TEXT_PLAIN);
Expand All @@ -114,7 +114,7 @@ public static function plainText(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function xml(string $objectId = null): self
public static function xml(?string $objectId = null): self
{
return static::create($objectId)
->mediaType(static::MEDIA_TYPE_TEXT_XML);
Expand All @@ -124,7 +124,7 @@ public static function xml(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function formUrlEncoded(string $objectId = null): self
public static function formUrlEncoded(?string $objectId = null): self
{
return static::create($objectId)
->mediaType(static::MEDIA_TYPE_APPLICATION_X_WWW_FORM_URLENCODED);
Expand Down
14 changes: 7 additions & 7 deletions src/Objects/Operation.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class Operation extends BaseObject
* @param string|null $objectId
* @return static
*/
public static function get(string $objectId = null): self
public static function get(?string $objectId = null): self
{
return static::create($objectId)->action(static::ACTION_GET);
}
Expand All @@ -116,7 +116,7 @@ public static function get(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function put(string $objectId = null): self
public static function put(?string $objectId = null): self
{
return static::create($objectId)->action(static::ACTION_PUT);
}
Expand All @@ -125,7 +125,7 @@ public static function put(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function post(string $objectId = null): self
public static function post(?string $objectId = null): self
{
return static::create($objectId)->action(static::ACTION_POST);
}
Expand All @@ -134,7 +134,7 @@ public static function post(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function delete(string $objectId = null): self
public static function delete(?string $objectId = null): self
{
return static::create($objectId)->action(static::ACTION_DELETE);
}
Expand All @@ -143,7 +143,7 @@ public static function delete(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function head(string $objectId = null): self
public static function head(?string $objectId = null): self
{
return static::create($objectId)->action(static::ACTION_HEAD);
}
Expand All @@ -152,7 +152,7 @@ public static function head(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function patch(string $objectId = null): self
public static function patch(?string $objectId = null): self
{
return static::create($objectId)->action(static::ACTION_PATCH);
}
Expand All @@ -161,7 +161,7 @@ public static function patch(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function trace(string $objectId = null): self
public static function trace(?string $objectId = null): self
{
return static::create($objectId)->action(static::ACTION_TRACE);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Objects/Parameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class Parameter extends BaseObject
* @param string|null $objectId
* @return static
*/
public static function query(string $objectId = null): self
public static function query(?string $objectId = null): self
{
return static::create($objectId)->in(static::IN_QUERY);
}
Expand All @@ -115,7 +115,7 @@ public static function query(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function header(string $objectId = null): self
public static function header(?string $objectId = null): self
{
return static::create($objectId)->in(static::IN_HEADER);
}
Expand All @@ -124,7 +124,7 @@ public static function header(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function path(string $objectId = null): self
public static function path(?string $objectId = null): self
{
return static::create($objectId)->in(static::IN_PATH);
}
Expand All @@ -133,7 +133,7 @@ public static function path(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function cookie(string $objectId = null): self
public static function cookie(?string $objectId = null): self
{
return static::create($objectId)->in(static::IN_COOKIE);
}
Expand Down
22 changes: 11 additions & 11 deletions src/Objects/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Response extends BaseObject
* @param string|null $objectId
* @return static
*/
public static function ok(string $objectId = null): self
public static function ok(?string $objectId = null): self
{
return static::create($objectId)
->statusCode(200)
Expand All @@ -55,7 +55,7 @@ public static function ok(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function created(string $objectId = null): self
public static function created(?string $objectId = null): self
{
return static::create($objectId)
->statusCode(201)
Expand All @@ -66,7 +66,7 @@ public static function created(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function movedPermanently(string $objectId = null): self
public static function movedPermanently(?string $objectId = null): self
{
return static::create($objectId)
->statusCode(301)
Expand All @@ -77,7 +77,7 @@ public static function movedPermanently(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function movedTemporarily(string $objectId = null): self
public static function movedTemporarily(?string $objectId = null): self
{
return static::create($objectId)
->statusCode(302)
Expand All @@ -88,7 +88,7 @@ public static function movedTemporarily(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function badRequest(string $objectId = null): self
public static function badRequest(?string $objectId = null): self
{
return static::create($objectId)
->statusCode(400)
Expand All @@ -99,7 +99,7 @@ public static function badRequest(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function unauthorized(string $objectId = null): self
public static function unauthorized(?string $objectId = null): self
{
return static::create($objectId)
->statusCode(401)
Expand All @@ -110,7 +110,7 @@ public static function unauthorized(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function forbidden(string $objectId = null): self
public static function forbidden(?string $objectId = null): self
{
return static::create($objectId)
->statusCode(403)
Expand All @@ -121,7 +121,7 @@ public static function forbidden(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function notFound(string $objectId = null): self
public static function notFound(?string $objectId = null): self
{
return static::create($objectId)
->statusCode(404)
Expand All @@ -132,7 +132,7 @@ public static function notFound(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function unprocessableEntity(string $objectId = null): self
public static function unprocessableEntity(?string $objectId = null): self
{
return static::create($objectId)
->statusCode(422)
Expand All @@ -143,7 +143,7 @@ public static function unprocessableEntity(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function tooManyRequests(string $objectId = null): self
public static function tooManyRequests(?string $objectId = null): self
{
return static::create($objectId)
->statusCode(429)
Expand All @@ -154,7 +154,7 @@ public static function tooManyRequests(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function internalServerError(string $objectId = null): self
public static function internalServerError(?string $objectId = null): self
{
return static::create($objectId)
->statusCode(500)
Expand Down
12 changes: 6 additions & 6 deletions src/Objects/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class Schema extends BaseObject implements SchemaContract
* @param string|null $objectId
* @return static
*/
public static function array(string $objectId = null): self
public static function array(?string $objectId = null): self
{
return static::create($objectId)->type(static::TYPE_ARRAY);
}
Expand All @@ -229,7 +229,7 @@ public static function array(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function boolean(string $objectId = null): self
public static function boolean(?string $objectId = null): self
{
return static::create($objectId)->type(static::TYPE_BOOLEAN);
}
Expand All @@ -238,7 +238,7 @@ public static function boolean(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function integer(string $objectId = null): self
public static function integer(?string $objectId = null): self
{
return static::create($objectId)->type(static::TYPE_INTEGER);
}
Expand All @@ -247,7 +247,7 @@ public static function integer(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function number(string $objectId = null): self
public static function number(?string $objectId = null): self
{
return static::create($objectId)->type(static::TYPE_NUMBER);
}
Expand All @@ -256,7 +256,7 @@ public static function number(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function object(string $objectId = null): self
public static function object(?string $objectId = null): self
{
return static::create($objectId)->type(static::TYPE_OBJECT);
}
Expand All @@ -265,7 +265,7 @@ public static function object(string $objectId = null): self
* @param string|null $objectId
* @return static
*/
public static function string(string $objectId = null): self
public static function string(?string $objectId = null): self
{
return static::create($objectId)->type(static::TYPE_STRING);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Objects/SecurityScheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class SecurityScheme extends BaseObject
* @param string|null $objectId
* @return static
*/
public static function oauth2(string $objectId = null): self
public static function oauth2(?string $objectId = null): self
{
return static::create($objectId)->type(static::TYPE_OAUTH2);
}
Expand Down