Skip to content

Commit 17096e2

Browse files
Feature/php8.3 support (#18)
* Fix styling * removed phpcpd * PHP coding style set to PER * Disabled phpmd for now * Bumped rector & code to 8.1 * replaced ? by null in @param * reinstated spatie/dto package for now * Fix styling --------- Co-authored-by: LaravelFreelancerNL <LaravelFreelancerNL@users.noreply.github.com>
1 parent 16e45d0 commit 17096e2

34 files changed

+168
-184
lines changed

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Setup PHP
2929
uses: shivammathur/setup-php@v2
3030
with:
31-
php-version: 8.0
31+
php-version: 8.3
3232
extensions: mbstring, intl
3333
ini-values: post_max_size=256M, short_open_tag=On
3434
coverage: xdebug

.github/workflows/run-tests.yml

Lines changed: 2 additions & 2 deletions
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.8, 3.9, 3.10]
16-
php: [8.0, 8.1, 8.2]
15+
arangodb: ["3.10", 3.11]
16+
php: [8.1, 8.2, 8.3]
1717
stability: [prefer-stable]
1818

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

bin/qa.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#!/usr/bin/env bash
22
printf "\nRun PHPMD\n"
3-
./vendor/bin/phpmd src/ text phpmd-ruleset.xml
4-
5-
printf "\nRun PHPCPD\n"
6-
./vendor/bin/phpcpd src
3+
# disabled for now @see: https://github.com/pdepend/pdepend/issues/695
4+
#./vendor/bin/phpmd src/ text phpmd-ruleset.xml
75

86
printf "\nRun PHPStan\n"
97
composer analyse

composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
"minimum-stability": "dev",
1717
"prefer-stable" : true,
1818
"require": {
19-
"php": "^8.0",
19+
"php": "^8.1",
2020
"ext-curl": "*",
2121
"ext-json": "*",
2222
"guzzlehttp/guzzle": "^7.3",
2323
"halaxa/json-machine": "^1.0",
24-
"spatie/data-transfer-object": "^3.1"
24+
"spatie/data-transfer-object": "^3.9"
2525
},
2626
"require-dev": {
2727
"laravel/pint": "^1.2.1",
@@ -30,8 +30,7 @@
3030
"phpstan/phpstan": "^1.0",
3131
"phpunit/phpunit": "^9.5",
3232
"rector/rector": "^0.14.8",
33-
"scrutinizer/ocular": "^1.8",
34-
"sebastian/phpcpd": "^6.0"
33+
"scrutinizer/ocular": "^1.8"
3534
},
3635
"autoload": {
3736
"psr-4": {

pint.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"preset": "per"
3+
}

rector.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88

99
return static function (RectorConfig $rectorConfig): void {
1010
$rectorConfig->paths([
11-
__DIR__.'/src',
12-
__DIR__.'/tests',
11+
__DIR__ . '/src',
12+
__DIR__ . '/tests',
1313
]);
1414

1515
// define sets of rules
1616
$rectorConfig->sets([
1717
SetList::CODE_QUALITY,
18-
LevelSetList::UP_TO_PHP_80,
18+
LevelSetList::UP_TO_PHP_81,
1919
]);
2020

2121
// Path to PHPStan with extensions, that PHPStan in Rector uses to determine types
22-
$rectorConfig->phpstanConfig(__DIR__.'/phpstan.neon.dist');
22+
$rectorConfig->phpstanConfig(__DIR__ . '/phpstan.neon.dist');
2323
};

src/Admin/AdminManager.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
class AdminManager extends Manager
1313
{
14-
public function __construct(protected ArangoClient $arangoClient)
15-
{
16-
}
14+
public function __construct(protected ArangoClient $arangoClient) {}
1715

1816
/**
1917
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)

src/ArangoClient.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function generateEndpoint(array $config): string
6262
$endpoint = (string) $config['host'];
6363
}
6464
if (isset($config['port'])) {
65-
$endpoint .= ':'.(string) $config['port'];
65+
$endpoint .= ':' . (string) $config['port'];
6666
}
6767

6868
return $endpoint;
@@ -126,11 +126,11 @@ public function debugRequest(
126126

127127
protected function prependDatabaseToUri(string $uri, ?string $database = null): string
128128
{
129-
if (! isset($database)) {
129+
if (!isset($database)) {
130130
$database = $this->config->database;
131131
}
132132

133-
return '/_db/'.urlencode($database).$uri;
133+
return '/_db/' . urlencode($database) . $uri;
134134
}
135135

136136
/**
@@ -148,10 +148,10 @@ protected function handleGuzzleException(Throwable $e): void
148148
}
149149

150150
throw(
151-
new ArangoException(
152-
$code.' - '.$message,
153-
$code
154-
)
151+
new ArangoException(
152+
$code . ' - ' . $message,
153+
$code
154+
)
155155
);
156156
}
157157

src/Exceptions/ArangoException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22

33
namespace ArangoClient\Exceptions;
44

5-
class ArangoException extends \Exception
6-
{
7-
}
5+
class ArangoException extends \Exception {}

src/HandlesJson.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function jsonEncode(mixed $data): string
2626
$response = json_encode($data, $options);
2727

2828
if ($response === false) {
29-
throw new ArangoException('JSON encoding failed with error: '.json_last_error_msg(), json_last_error());
29+
throw new ArangoException('JSON encoding failed with error: ' . json_last_error_msg(), json_last_error());
3030
}
3131

3232
return $response;
@@ -38,7 +38,7 @@ public function jsonEncode(mixed $data): string
3838
protected function decodeResponse(?ResponseInterface $response): stdClass
3939
{
4040
$decodedResponse = new stdClass();
41-
if (! isset($response)) {
41+
if (!isset($response)) {
4242
return $decodedResponse;
4343
}
4444

0 commit comments

Comments
 (0)