Skip to content

Commit 0b1a548

Browse files
Fixed deprecations
1 parent 052a32a commit 0b1a548

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

src/ArangoClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class ArangoClient
4242
*
4343
* @throws UnknownProperties
4444
*/
45-
public function __construct(array $config = [], GuzzleClient $httpClient = null)
45+
public function __construct(array $config = [], ?GuzzleClient $httpClient = null)
4646
{
4747
$config['endpoint'] = $this->generateEndpoint($config);
4848
$this->config = new HttpClientConfig($config);
@@ -196,7 +196,7 @@ public function prepare(
196196
/**
197197
* @return mixed
198198
*/
199-
public function getConfig(string $value = null): mixed
199+
public function getConfig(?string $value = null): mixed
200200
{
201201
if ($value) {
202202
return $this->config->$value;

src/Monitor/MonitorManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ public function getCurrentConnections(): int
2424

2525
return $metrics->arangodb_http1_connections_total->value + $metrics->arangodb_http2_connections_total->value;
2626
}
27-
}
27+
}

src/Prometheus/Metric.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ public function __construct(
2525
public int|float|null $value = null,
2626
public ?array $buckets = [],
2727
public ?array $labels = [],
28+
public null|int $timestamp = null,
2829
) {}
2930
}

src/Transactions/SupportsTransactions.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function beginTransaction(array $collections = [], array $options = []):
5353
*
5454
* @throws ArangoException
5555
*/
56-
public function abort(string $id = null): bool
56+
public function abort(?string $id = null): bool
5757
{
5858
return $this->transactions()->abort($id);
5959
}
@@ -64,7 +64,7 @@ public function abort(string $id = null): bool
6464
*
6565
* @throws ArangoException
6666
*/
67-
public function rollBack(string $id = null): bool
67+
public function rollBack(?string $id = null): bool
6868
{
6969
return $this->transactions()->abort($id);
7070
}
@@ -75,7 +75,7 @@ public function rollBack(string $id = null): bool
7575
*
7676
* @throws ArangoException
7777
*/
78-
public function commit(string $id = null): bool
78+
public function commit(?string $id = null): bool
7979
{
8080
return $this->transactions()->commit($id);
8181
}
@@ -89,8 +89,8 @@ public function transactionAwareRequest(
8989
string $method,
9090
string $uri,
9191
array|HttpRequestOptions $options = [],
92-
string $database = null,
93-
int $transactionId = null,
92+
?string $database = null,
93+
?int $transactionId = null,
9494
): stdClass {
9595
if (is_array($options)) {
9696
$options = $this->prepareRequestOptions($options);

src/Transactions/TransactionManager.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function getTransactions(): array
3737
/**
3838
* @throws ArangoException
3939
*/
40-
public function getTransaction(string $id = null): string
40+
public function getTransaction(?string $id = null): string
4141
{
4242
$this->validateId($id);
4343

@@ -72,7 +72,7 @@ public function begin(array $collections = [], array $options = []): string
7272
/**
7373
* @throws ArangoException
7474
*/
75-
public function commit(string $id = null): bool
75+
public function commit(?string $id = null): bool
7676
{
7777
$id = $this->getTransaction($id);
7878

@@ -87,7 +87,7 @@ public function commit(string $id = null): bool
8787
/**
8888
* @throws ArangoException
8989
*/
90-
public function abort(string $id = null): bool
90+
public function abort(?string $id = null): bool
9191
{
9292
$id = $this->getTransaction($id);
9393

@@ -102,7 +102,7 @@ public function abort(string $id = null): bool
102102
/**
103103
* @throws ArangoException
104104
*/
105-
protected function validateId(string $id = null): bool
105+
protected function validateId(?string $id = null): bool
106106
{
107107
if (
108108
empty($this->transactions)

0 commit comments

Comments
 (0)