diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 646bf37..7a475d2 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -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 }} diff --git a/phpunit.xml b/phpunit.xml index e12801e..9a7472c 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,21 +1,16 @@ - - - - tests - - - - - tests - - - - - + + + + tests + + + + + + + + tests + + diff --git a/src/ArangoClient.php b/src/ArangoClient.php index 9f69e35..e5d42e7 100644 --- a/src/ArangoClient.php +++ b/src/ArangoClient.php @@ -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); @@ -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; diff --git a/src/Prometheus/Metric.php b/src/Prometheus/Metric.php index 72a8173..dd170fb 100644 --- a/src/Prometheus/Metric.php +++ b/src/Prometheus/Metric.php @@ -25,5 +25,6 @@ public function __construct( public int|float|null $value = null, public ?array $buckets = [], public ?array $labels = [], + public null|int $timestamp = null, ) {} } diff --git a/src/Transactions/SupportsTransactions.php b/src/Transactions/SupportsTransactions.php index 127be4b..2d852e3 100644 --- a/src/Transactions/SupportsTransactions.php +++ b/src/Transactions/SupportsTransactions.php @@ -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); } @@ -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); } @@ -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); } @@ -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); diff --git a/src/Transactions/TransactionManager.php b/src/Transactions/TransactionManager.php index 97aa04f..872e0c8 100644 --- a/src/Transactions/TransactionManager.php +++ b/src/Transactions/TransactionManager.php @@ -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); @@ -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); @@ -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); @@ -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)