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
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest]
arangodb: ["3.10", 3.11, 3.12]
php: [8.2, 8.3]
arangodb: [3.11, 3.12]
php: [8.2, 8.3, 8.4]
stability: [prefer-stable]

name: P${{ matrix.php }} - A${{ matrix.arangodb }} - ${{ matrix.stability }}
Expand Down
33 changes: 14 additions & 19 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
stopOnFailure="false"
>
<testsuites>
<testsuite name="all">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">tests</directory>
</include>
</coverage>
<php>
<env name="ARANGODB_VERSION" value="3.12"/>
</php>
<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">
<testsuites>
<testsuite name="all">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>
<php>
<env name="ARANGODB_VERSION" value="3.12"/>
</php>
<source>
<include>
<directory suffix=".php">tests</directory>
</include>
</source>
</phpunit>
4 changes: 2 additions & 2 deletions src/ArangoClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ArangoClient
*
* @throws UnknownProperties
*/
public function __construct(array $config = [], GuzzleClient $httpClient = null)
public function __construct(array $config = [], ?GuzzleClient $httpClient = null)
{
$config['endpoint'] = $this->generateEndpoint($config);
$this->config = new HttpClientConfig($config);
Expand Down Expand Up @@ -196,7 +196,7 @@ public function prepare(
/**
* @return mixed
*/
public function getConfig(string $value = null): mixed
public function getConfig(?string $value = null): mixed
{
if ($value) {
return $this->config->$value;
Expand Down
1 change: 1 addition & 0 deletions src/Prometheus/Metric.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ public function __construct(
public int|float|null $value = null,
public ?array $buckets = [],
public ?array $labels = [],
public null|int $timestamp = null,
) {}
}
10 changes: 5 additions & 5 deletions src/Transactions/SupportsTransactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function beginTransaction(array $collections = [], array $options = []):
*
* @throws ArangoException
*/
public function abort(string $id = null): bool
public function abort(?string $id = null): bool
{
return $this->transactions()->abort($id);
}
Expand All @@ -64,7 +64,7 @@ public function abort(string $id = null): bool
*
* @throws ArangoException
*/
public function rollBack(string $id = null): bool
public function rollBack(?string $id = null): bool
{
return $this->transactions()->abort($id);
}
Expand All @@ -75,7 +75,7 @@ public function rollBack(string $id = null): bool
*
* @throws ArangoException
*/
public function commit(string $id = null): bool
public function commit(?string $id = null): bool
{
return $this->transactions()->commit($id);
}
Expand All @@ -89,8 +89,8 @@ public function transactionAwareRequest(
string $method,
string $uri,
array|HttpRequestOptions $options = [],
string $database = null,
int $transactionId = null,
?string $database = null,
?int $transactionId = null,
): stdClass {
if (is_array($options)) {
$options = $this->prepareRequestOptions($options);
Expand Down
8 changes: 4 additions & 4 deletions src/Transactions/TransactionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function getTransactions(): array
/**
* @throws ArangoException
*/
public function getTransaction(string $id = null): string
public function getTransaction(?string $id = null): string
{
$this->validateId($id);

Expand Down Expand Up @@ -72,7 +72,7 @@ public function begin(array $collections = [], array $options = []): string
/**
* @throws ArangoException
*/
public function commit(string $id = null): bool
public function commit(?string $id = null): bool
{
$id = $this->getTransaction($id);

Expand All @@ -87,7 +87,7 @@ public function commit(string $id = null): bool
/**
* @throws ArangoException
*/
public function abort(string $id = null): bool
public function abort(?string $id = null): bool
{
$id = $this->getTransaction($id);

Expand All @@ -102,7 +102,7 @@ public function abort(string $id = null): bool
/**
* @throws ArangoException
*/
protected function validateId(string $id = null): bool
protected function validateId(?string $id = null): bool
{
if (
empty($this->transactions)
Expand Down