Skip to content

Commit 28dbf19

Browse files
Chore/php84 support (#36)
* Feature: Added getCurrentConnections to MonitorManager.php * Migrated configuration * Added php8.4 to the matrix Removed ArangoDB 3.10 from the matrix * Fixed deprecations
1 parent 3e06104 commit 28dbf19

File tree

6 files changed

+28
-32
lines changed

6 files changed

+28
-32
lines changed

.github/workflows/run-tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
fail-fast: true
1313
matrix:
1414
os: [ubuntu-latest]
15-
arangodb: ["3.10", 3.11, 3.12]
16-
php: [8.2, 8.3]
15+
arangodb: [3.11, 3.12]
16+
php: [8.2, 8.3, 8.4]
1717
stability: [prefer-stable]
1818

1919
name: P${{ matrix.php }} - A${{ matrix.arangodb }} - ${{ matrix.stability }}

phpunit.xml

+14-19
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
4-
bootstrap="vendor/autoload.php"
5-
colors="true"
6-
stopOnFailure="false"
7-
>
8-
<testsuites>
9-
<testsuite name="all">
10-
<directory suffix="Test.php">tests</directory>
11-
</testsuite>
12-
</testsuites>
13-
<coverage processUncoveredFiles="true">
14-
<include>
15-
<directory suffix=".php">tests</directory>
16-
</include>
17-
</coverage>
18-
<php>
19-
<env name="ARANGODB_VERSION" value="3.12"/>
20-
</php>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true" stopOnFailure="false" cacheDirectory=".phpunit.cache">
3+
<testsuites>
4+
<testsuite name="all">
5+
<directory suffix="Test.php">tests</directory>
6+
</testsuite>
7+
</testsuites>
8+
<php>
9+
<env name="ARANGODB_VERSION" value="3.12"/>
10+
</php>
11+
<source>
12+
<include>
13+
<directory suffix=".php">tests</directory>
14+
</include>
15+
</source>
2116
</phpunit>

src/ArangoClient.php

+2-2
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/Prometheus/Metric.php

+1
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

+5-5
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

+4-4
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)