Skip to content

Commit d168fdc

Browse files
chore[PHP-8.4]: Handle php 8.4 deprecations (#18)
* chore[php-8.4]: handle php 8.4 deprecations * chore[php-8.4]: revert enforcing strict type on 'Admin\Task\Task::'
1 parent cb97abc commit d168fdc

File tree

14 files changed

+16
-16
lines changed

14 files changed

+16
-16
lines changed

src/AQL/Functions/AQLFunction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class AQLFunction implements EntityInterface
6060
* @param bool $isDeterministic Indicates if the function results are deterministic.
6161
* @param bool $isNew Indicates if the function object is a new one or not.
6262
*/
63-
public function __construct(string $name, string $code, Connection $connection = null, bool $isDeterministic = true, bool $isNew = true)
63+
public function __construct(string $name, string $code, ?Connection $connection = null, bool $isDeterministic = true, bool $isNew = true)
6464
{
6565
$this->name = $name;
6666
$this->code = $code;

src/Admin/Task/Task.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Task implements EntityInterface
3434
*
3535
* @var string
3636
*/
37-
protected $type = 'unknown';
37+
protected string $type = 'unknown';
3838

3939
/**
4040
* Attributes of task.
@@ -79,7 +79,7 @@ class Task implements EntityInterface
7979
*
8080
* @throws InvalidParameterException|MissingParameterException
8181
*/
82-
public function __construct(string $name, string $command, Connection $connection = null, array $options = [])
82+
public function __construct(string $name, string $command, ?Connection $connection = null, array $options = [])
8383
{
8484
$attributes = array_merge($this->defaultOptions, ['name' => $name, 'command' => $command], $options);
8585
$validator = new TaskValidator($attributes);
@@ -186,7 +186,7 @@ public function setCommand(string $command): void
186186
*
187187
* @param Connection $connection Connection object to use.
188188
*/
189-
public function setConnection(Connection $connection)
189+
public function setConnection(Connection $connection): void
190190
{
191191
$this->connection = $connection;
192192
}

src/Auth/Exceptions/AuthException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class AuthException extends BaseException
2222
* @param Throwable|null $previous
2323
* @param int $code
2424
*/
25-
public function __construct(string $message, Throwable $previous = null, $code = 0)
25+
public function __construct(string $message, ?Throwable $previous = null, $code = 0)
2626
{
2727
parent::__construct($message, $previous, $code);
2828
}

src/Auth/Exceptions/UserException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class UserException extends BaseException
2222
* @param Throwable|null $previous
2323
* @param int $code
2424
*/
25-
public function __construct(string $message, Throwable $previous = null, int $code = 0)
25+
public function __construct(string $message, ?Throwable $previous = null, int $code = 0)
2626
{
2727
parent::__construct($message, $previous, $code);
2828
}

src/Auth/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class User implements EntityInterface
6262
*
6363
* @throws InvalidParameterException|MissingParameterException
6464
*/
65-
public function __construct(array $attributes = [], Connection $connection = null, bool $isNew = true)
65+
public function __construct(array $attributes = [], ?Connection $connection = null, bool $isNew = true)
6666
{
6767
$validator = new UserValidator($attributes);
6868
$validator->validate();

src/Document/Document.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class Document implements EntityInterface
112112
*
113113
* @throws InvalidParameterException
114114
*/
115-
public function __construct(array $attributes = [], Collection $collection = null)
115+
public function __construct(array $attributes = [], ?Collection $collection = null)
116116
{
117117
$this->validator = new DocumentValidator($attributes);
118118
$this->validator->validate();

src/Document/Edge.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Edge extends Document
4949
*
5050
* @throws InvalidParameterException|MissingParameterException
5151
*/
52-
public function __construct(array $attributes = [], Collection $collection = null)
52+
public function __construct(array $attributes = [], ?Collection $collection = null)
5353
{
5454
$validator = new EdgeValidator($attributes);
5555
$validator->validate();

src/Exceptions/BaseException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ abstract class BaseException extends \Exception
2121
* @param Throwable|null $previous Previous exception or error.
2222
* @param int $code Error code.
2323
*/
24-
public function __construct(string $message, Throwable $previous = null, $code = 0)
24+
public function __construct(string $message, ?Throwable $previous = null, $code = 0)
2525
{
2626
parent::__construct($message, $code, $previous);
2727
}

src/Graph/Graph.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class Graph implements \JsonSerializable
106106
*
107107
* @throws InvalidParameterException|MissingParameterException|ArangoException
108108
*/
109-
public function __construct(string $name, array $attributes = [], Database $database = null)
109+
public function __construct(string $name, array $attributes = [], ?Database $database = null)
110110
{
111111
$this->name = $this->key = $name;
112112

src/Graph/Traversal/Traversal.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class Traversal
7272
*
7373
* @throws CursorException|GuzzleException
7474
*/
75-
public function __construct(Statement $statement, Connection $connection = null)
75+
public function __construct(Statement $statement, ?Connection $connection = null)
7676
{
7777
$this->statement = $statement;
7878
$this->connection = $connection;

0 commit comments

Comments
 (0)