Skip to content
Merged
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/AQL/Functions/AQLFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class AQLFunction implements EntityInterface
* @param bool $isDeterministic Indicates if the function results are deterministic.
* @param bool $isNew Indicates if the function object is a new one or not.
*/
public function __construct(string $name, string $code, Connection $connection = null, bool $isDeterministic = true, bool $isNew = true)
public function __construct(string $name, string $code, ?Connection $connection = null, bool $isDeterministic = true, bool $isNew = true)
{
$this->name = $name;
$this->code = $code;
Expand Down
6 changes: 3 additions & 3 deletions src/Admin/Task/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Task implements EntityInterface
*
* @var string
*/
protected $type = 'unknown';
protected string $type = 'unknown';

/**
* Attributes of task.
Expand Down Expand Up @@ -79,7 +79,7 @@ class Task implements EntityInterface
*
* @throws InvalidParameterException|MissingParameterException
*/
public function __construct(string $name, string $command, Connection $connection = null, array $options = [])
public function __construct(string $name, string $command, ?Connection $connection = null, array $options = [])
{
$attributes = array_merge($this->defaultOptions, ['name' => $name, 'command' => $command], $options);
$validator = new TaskValidator($attributes);
Expand Down Expand Up @@ -186,7 +186,7 @@ public function setCommand(string $command): void
*
* @param Connection $connection Connection object to use.
*/
public function setConnection(Connection $connection)
public function setConnection(Connection $connection): void
{
$this->connection = $connection;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Auth/Exceptions/AuthException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AuthException extends BaseException
* @param Throwable|null $previous
* @param int $code
*/
public function __construct(string $message, Throwable $previous = null, $code = 0)
public function __construct(string $message, ?Throwable $previous = null, $code = 0)
{
parent::__construct($message, $previous, $code);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Auth/Exceptions/UserException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class UserException extends BaseException
* @param Throwable|null $previous
* @param int $code
*/
public function __construct(string $message, Throwable $previous = null, int $code = 0)
public function __construct(string $message, ?Throwable $previous = null, int $code = 0)
{
parent::__construct($message, $previous, $code);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Auth/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class User implements EntityInterface
*
* @throws InvalidParameterException|MissingParameterException
*/
public function __construct(array $attributes = [], Connection $connection = null, bool $isNew = true)
public function __construct(array $attributes = [], ?Connection $connection = null, bool $isNew = true)
{
$validator = new UserValidator($attributes);
$validator->validate();
Expand Down
2 changes: 1 addition & 1 deletion src/Document/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class Document implements EntityInterface
*
* @throws InvalidParameterException
*/
public function __construct(array $attributes = [], Collection $collection = null)
public function __construct(array $attributes = [], ?Collection $collection = null)
{
$this->validator = new DocumentValidator($attributes);
$this->validator->validate();
Expand Down
2 changes: 1 addition & 1 deletion src/Document/Edge.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Edge extends Document
*
* @throws InvalidParameterException|MissingParameterException
*/
public function __construct(array $attributes = [], Collection $collection = null)
public function __construct(array $attributes = [], ?Collection $collection = null)
{
$validator = new EdgeValidator($attributes);
$validator->validate();
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/BaseException.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ abstract class BaseException extends \Exception
* @param Throwable|null $previous Previous exception or error.
* @param int $code Error code.
*/
public function __construct(string $message, Throwable $previous = null, $code = 0)
public function __construct(string $message, ?Throwable $previous = null, $code = 0)
{
parent::__construct($message, $code, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Graph/Graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class Graph implements \JsonSerializable
*
* @throws InvalidParameterException|MissingParameterException|ArangoException
*/
public function __construct(string $name, array $attributes = [], Database $database = null)
public function __construct(string $name, array $attributes = [], ?Database $database = null)
{
$this->name = $this->key = $name;

Expand Down
2 changes: 1 addition & 1 deletion src/Graph/Traversal/Traversal.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Traversal
*
* @throws CursorException|GuzzleException
*/
public function __construct(Statement $statement, Connection $connection = null)
public function __construct(Statement $statement, ?Connection $connection = null)
{
$this->statement = $statement;
$this->connection = $connection;
Expand Down
2 changes: 1 addition & 1 deletion src/Validation/Exceptions/InvalidKeyOptionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class InvalidKeyOptionException extends BaseException
* @param string $value Parameter value.
* @param Throwable|null $previous Previous exception or error.
*/
public function __construct(string $parameter, $value, Throwable $previous = null)
public function __construct(string $parameter, $value, ?Throwable $previous = null)
{
$message = "Parameter '$parameter' can not be used for collection with key type of '$value'.";
parent::__construct($message, $previous);
Expand Down
2 changes: 1 addition & 1 deletion src/Validation/Exceptions/InvalidParameterException.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class InvalidParameterException extends BaseException
* @param mixed $value Parameter value.
* @param Throwable|null $previous Previous exception or error.
*/
public function __construct($parameter, $value, Throwable $previous = null)
public function __construct($parameter, $value, ?Throwable $previous = null)
{
$this->value = is_array($value) ? json_encode($value) : $value;
$this->parameter = $parameter;
Expand Down
2 changes: 1 addition & 1 deletion src/Validation/Exceptions/MissingParameterException.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MissingParameterException extends BaseException
* @param string $parameter Parameter name.
* @param Throwable|null $previous Previous exception or error.
*/
public function __construct(string $parameter, Throwable $previous = null)
public function __construct(string $parameter, ?Throwable $previous = null)
{
$this->parameter = $parameter;
$message = "Missing '$parameter' on: " . $this->getFile() . " in line " . $this->getLine();
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function loadEnvironment(): void
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \ReflectionException
*/
public function getConnectionObject(MockHandler $mock = null): Connection
public function getConnectionObject(?MockHandler $mock = null): Connection
{
$connection = new Connection([
'username' => $_ENV['ARANGODB_USERNAME'],
Expand Down