Skip to content

Commit 585ec9b

Browse files
authored
Small CI optimisations (#96)
* fix CI * drop symfony 5.4 support
1 parent fa4b6ca commit 585ec9b

24 files changed

+112
-139
lines changed

.github/workflows/static-analysis.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,25 @@ jobs:
1010
name: "Lint & Analyse"
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1414
- uses: php-actions/composer@v6
1515
with:
1616
progress: yes
17-
php_version: 8.1
17+
php_version: 8.4
1818
version: 2
19-
- name: "PHP-CS-Fixer"
20-
run: composer check-cs
21-
- name: "PSalm"
22-
run: composer psalm
19+
- name: Lint & Analyse
20+
uses: php-actions/composer@v6
21+
env:
22+
PHP_CS_FIXER_IGNORE_ENV: "1"
23+
with:
24+
php_version: "8.4"
25+
version: 2
26+
command: check-cs
27+
28+
- name: Run Psalm
29+
uses: php-actions/composer@v6
30+
with:
31+
php_version: "8.4"
32+
version: 2
33+
command: psalm
34+

.github/workflows/tests.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ jobs:
1515
strategy:
1616
max-parallel: 10
1717
matrix:
18-
php: [ '8.1', '8.2', '8.3' ]
19-
sf_version: [ '5.4', '6.4', '7.1' ]
18+
php: [ '8.1', '8.2', '8.4' ]
19+
sf_version: [ '6.4', '7.2', '7.3' ]
2020
exclude:
2121
- php: 8.1
22-
sf_version: 7.1
22+
sf_version: 7.2
23+
- php: 8.1
24+
sf_version: 7.3
2325

2426
steps:
2527
- uses: actions/checkout@v2

composer.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,26 @@
1919
"laudis/neo4j-php-client": "^3.3",
2020
"twig/twig": "^3.0",
2121
"ext-json": "*",
22-
"symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0",
23-
"symfony/config": "^5.4 || ^6.0 || ^7.0"
22+
"symfony/dependency-injection": "^6.4 || ^7.2",
23+
"symfony/config": "^6.4 || ^7.2"
2424
},
2525
"require-dev": {
26-
"friendsofphp/php-cs-fixer": "^3.30",
26+
"friendsofphp/php-cs-fixer": "^3.75",
2727
"kubawerlos/php-cs-fixer-custom-fixers": "^3.0",
2828
"matthiasnoback/symfony-dependency-injection-test": "^4.3 || ^5.0",
2929
"phpunit/phpunit": "^9.5",
3030
"psalm/plugin-phpunit": "^0.19.5",
3131
"psalm/plugin-symfony": "^5.0",
32-
"symfony/console": "^5.4 || ^6.0 || ^7.0",
33-
"symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0",
34-
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0",
35-
"symfony/routing": "^5.4 || ^6.0 || ^7.0",
36-
"symfony/stopwatch": "^6.4",
32+
"symfony/console": "^6.4 || ^7.2",
33+
"symfony/framework-bundle": "^6.4 || ^7.2",
34+
"symfony/http-kernel": "^6.4 || ^7.2",
35+
"symfony/routing": "^6.4 || ^7.2",
36+
"symfony/stopwatch": "^6.4 || ^7.2",
3737
"symfony/test-pack": "^1.1",
38-
"symfony/twig-bundle": "^5.4 || ^6.0 || ^7.0",
39-
"symfony/uid": "^6.4",
40-
"symfony/web-profiler-bundle": "^5.4 || ^6.0 || ^7.0",
41-
"symfony/yaml": "^5.4 || ^6.0 || ^7.0",
38+
"symfony/twig-bundle": "^6.4 || ^7.2",
39+
"symfony/uid": "^6.4 || ^7.2",
40+
"symfony/web-profiler-bundle": "^6.4 || ^7.2",
41+
"symfony/yaml": "^6.4 || ^7.2",
4242
"vimeo/psalm": "^6.11"
4343
},
4444
"autoload": {

src/Builders/ClientBuilder.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ final class ClientBuilder
2020

2121
/**
2222
* @psalm-mutation-free
23-
*
24-
* @param DriverSetupManager $driverSetups
2523
*/
2624
public function __construct(
2725
private SessionConfiguration $defaultSessionConfig,

src/Collector/Neo4jDataCollector.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
namespace Neo4j\Neo4jBundle\Collector;
66

77
use Neo4j\Neo4jBundle\EventListener\Neo4jProfileListener;
8-
use Override;
98
use Symfony\Bundle\FrameworkBundle\DataCollector\AbstractDataCollector;
109
use Symfony\Component\HttpFoundation\Request;
1110
use Symfony\Component\HttpFoundation\Response;
12-
use Throwable;
1311

1412
/**
1513
* @var array{
@@ -29,8 +27,8 @@ public function __construct(
2927
) {
3028
}
3129

32-
#[Override]
33-
public function collect(Request $request, Response $response, ?Throwable $exception = null): void
30+
#[\Override]
31+
public function collect(Request $request, Response $response, ?\Throwable $exception = null): void
3432
{
3533
$t = $this;
3634
$profiledSummaries = $this->subscriber->getProfiledSummaries();
@@ -78,14 +76,14 @@ public function collect(Request $request, Response $response, ?Throwable $except
7876
$this->data['statements'] = $mergedArray;
7977
}
8078

81-
#[Override]
79+
#[\Override]
8280
public function reset(): void
8381
{
8482
parent::reset();
8583
$this->subscriber->reset();
8684
}
8785

88-
#[Override]
86+
#[\Override]
8987
public function getName(): string
9088
{
9189
return 'neo4j';
@@ -130,7 +128,7 @@ public function getQueryCount(): int
130128
return count($this->data['statements']);
131129
}
132130

133-
#[Override]
131+
#[\Override]
134132
public static function getTemplate(): ?string
135133
{
136134
return '@Neo4j/web_profiler.html.twig';

src/Decorators/SymfonyClient.php

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
use Laudis\Neo4j\Databags\TransactionConfiguration;
1616
use Laudis\Neo4j\Enum\AccessMode;
1717
use Laudis\Neo4j\Types\CypherList;
18-
use Laudis\Neo4j\Types\CypherMap;
1918
use Neo4j\Neo4jBundle\Factories\SymfonyDriverFactory;
20-
use Override;
2119

2220
final class SymfonyClient implements ClientInterface
2321
{
@@ -33,8 +31,6 @@ final class SymfonyClient implements ClientInterface
3331

3432
/**
3533
* @psalm-mutation-free
36-
*
37-
* @param DriverSetupManager $driverSetups
3834
*/
3935
public function __construct(
4036
private readonly DriverSetupManager $driverSetups,
@@ -54,13 +50,13 @@ public function getDefaultTransactionConfiguration(): TransactionConfiguration
5450
return $this->defaultTransactionConfiguration;
5551
}
5652

57-
#[Override]
53+
#[\Override]
5854
public function run(string $statement, iterable $parameters = [], ?string $alias = null): SummarizedResult
5955
{
6056
return $this->runStatement(Statement::create($statement, $parameters), $alias);
6157
}
6258

63-
#[Override]
59+
#[\Override]
6460
public function runStatement(Statement $statement, ?string $alias = null): SummarizedResult
6561
{
6662
return $this->runStatements([$statement], $alias)->first();
@@ -91,7 +87,7 @@ private function getSession(?string $alias = null): SymfonySession
9187
return $this->boundSessions[$alias] = $this->startSession($alias, $this->defaultSessionConfiguration);
9288
}
9389

94-
#[Override]
90+
#[\Override]
9591
public function runStatements(iterable $statements, ?string $alias = null): CypherList
9692
{
9793
$runner = $this->getRunner($alias);
@@ -102,7 +98,7 @@ public function runStatements(iterable $statements, ?string $alias = null): Cyph
10298
return $runner->runStatements($statements);
10399
}
104100

105-
#[Override]
101+
#[\Override]
106102
public function beginTransaction(?iterable $statements = null, ?string $alias = null, ?TransactionConfiguration $config = null): SymfonyTransaction
107103
{
108104
$session = $this->getSession($alias);
@@ -111,7 +107,7 @@ public function beginTransaction(?iterable $statements = null, ?string $alias =
111107
return $session->beginTransaction($statements, $config);
112108
}
113109

114-
#[Override]
110+
#[\Override]
115111
public function getDriver(?string $alias): SymfonyDriver
116112
{
117113
return $this->factory->createDriver(
@@ -138,7 +134,7 @@ private function startSession(?string $alias, SessionConfiguration $configuratio
138134
*
139135
* @return HandlerResult
140136
*/
141-
#[Override]
137+
#[\Override]
142138
public function writeTransaction(callable $tsxHandler, ?string $alias = null, ?TransactionConfiguration $config = null): mixed
143139
{
144140
if ($this->defaultSessionConfiguration->getAccessMode() === AccessMode::WRITE()) {
@@ -158,7 +154,7 @@ public function writeTransaction(callable $tsxHandler, ?string $alias = null, ?T
158154
*
159155
* @return HandlerResult
160156
*/
161-
#[Override]
157+
#[\Override]
162158
public function readTransaction(callable $tsxHandler, ?string $alias = null, ?TransactionConfiguration $config = null): mixed
163159
{
164160
if ($this->defaultSessionConfiguration->getAccessMode() === AccessMode::READ()) {
@@ -178,25 +174,25 @@ public function readTransaction(callable $tsxHandler, ?string $alias = null, ?Tr
178174
*
179175
* @return HandlerResult
180176
*/
181-
#[Override]
177+
#[\Override]
182178
public function transaction(callable $tsxHandler, ?string $alias = null, ?TransactionConfiguration $config = null)
183179
{
184180
return $this->writeTransaction($tsxHandler, $alias, $config);
185181
}
186182

187-
#[Override]
183+
#[\Override]
188184
public function verifyConnectivity(?string $driver = null): bool
189185
{
190186
return $this->driverSetups->verifyConnectivity($this->defaultSessionConfiguration, $driver);
191187
}
192188

193-
#[Override]
189+
#[\Override]
194190
public function hasDriver(string $alias): bool
195191
{
196192
return $this->driverSetups->hasDriver($alias);
197193
}
198194

199-
#[Override]
195+
#[\Override]
200196
public function bindTransaction(?string $alias = null, ?TransactionConfiguration $config = null): void
201197
{
202198
$alias ??= $this->driverSetups->getDefaultAlias();
@@ -205,7 +201,7 @@ public function bindTransaction(?string $alias = null, ?TransactionConfiguration
205201
$this->boundTransactions[$alias][] = $this->beginTransaction(null, $alias, $config);
206202
}
207203

208-
#[Override]
204+
#[\Override]
209205
public function rollbackBoundTransaction(?string $alias = null, int $depth = 1): void
210206
{
211207
$this->popTransactions(static fn (SymfonyTransaction $tsx) => $tsx->rollback(), $alias, $depth);
@@ -231,7 +227,7 @@ private function popTransactions(callable $handler, ?string $alias = null, int $
231227
}
232228
}
233229

234-
#[Override]
230+
#[\Override]
235231
public function commitBoundTransaction(?string $alias = null, int $depth = 1): void
236232
{
237233
$this->popTransactions(static fn (UnmanagedTransactionInterface $tsx) => $tsx->commit(), $alias, $depth);

src/Decorators/SymfonyDriver.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use Laudis\Neo4j\Contracts\DriverInterface;
77
use Laudis\Neo4j\Databags\SessionConfiguration;
88
use Neo4j\Neo4jBundle\Factories\SymfonyDriverFactory;
9-
use Override;
109

1110
/**
1211
* @psalm-suppress MissingImmutableAnnotation
@@ -21,19 +20,19 @@ public function __construct(
2120
) {
2221
}
2322

24-
#[Override]
23+
#[\Override]
2524
public function createSession(?SessionConfiguration $config = null): SymfonySession
2625
{
2726
return $this->factory->createSession($this->driver, $config, $this->alias, $this->schema);
2827
}
2928

30-
#[Override]
29+
#[\Override]
3130
public function verifyConnectivity(?SessionConfiguration $config = null): bool
3231
{
3332
return $this->driver->verifyConnectivity();
3433
}
3534

36-
#[Override]
35+
#[\Override]
3736
public function closeConnections(): void
3837
{
3938
$this->driver->closeConnections();

src/Decorators/SymfonySession.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
use Laudis\Neo4j\Databags\SummarizedResult;
1111
use Laudis\Neo4j\Databags\TransactionConfiguration;
1212
use Laudis\Neo4j\Types\CypherList;
13-
use Laudis\Neo4j\Types\CypherMap;
1413
use Neo4j\Neo4jBundle\EventHandler;
1514
use Neo4j\Neo4jBundle\Factories\SymfonyDriverFactory;
16-
use Override;
1715

1816
final class SymfonySession implements SessionInterface
1917
{
@@ -26,7 +24,7 @@ public function __construct(
2624
) {
2725
}
2826

29-
#[Override]
27+
#[\Override]
3028
public function runStatements(iterable $statements, ?TransactionConfiguration $config = null): CypherList
3129
{
3230
$tbr = [];
@@ -37,7 +35,7 @@ public function runStatements(iterable $statements, ?TransactionConfiguration $c
3735
return CypherList::fromIterable($tbr);
3836
}
3937

40-
#[Override]
38+
#[\Override]
4139
public function runStatement(Statement $statement, ?TransactionConfiguration $config = null): SummarizedResult
4240
{
4341
return $this->handler->handleQuery(
@@ -49,13 +47,13 @@ public function runStatement(Statement $statement, ?TransactionConfiguration $co
4947
);
5048
}
5149

52-
#[Override]
50+
#[\Override]
5351
public function run(string $statement, iterable $parameters = [], ?TransactionConfiguration $config = null): SummarizedResult
5452
{
5553
return $this->runStatement(new Statement($statement, $parameters));
5654
}
5755

58-
#[Override]
56+
#[\Override]
5957
public function beginTransaction(?iterable $statements = null, ?TransactionConfiguration $config = null): SymfonyTransaction
6058
{
6159
return $this->factory->createTransaction(
@@ -75,7 +73,7 @@ public function beginTransaction(?iterable $statements = null, ?TransactionConfi
7573
*
7674
* @psalm-suppress ArgumentTypeCoercion
7775
*/
78-
#[Override]
76+
#[\Override]
7977
public function writeTransaction(callable $tsxHandler, ?TransactionConfiguration $config = null)
8078
{
8179
return TransactionHelper::retry(
@@ -91,7 +89,7 @@ public function writeTransaction(callable $tsxHandler, ?TransactionConfiguration
9189
*
9290
* @return HandlerResult
9391
*/
94-
#[Override]
92+
#[\Override]
9593
public function readTransaction(callable $tsxHandler, ?TransactionConfiguration $config = null)
9694
{
9795
// TODO: create read transaction here.
@@ -105,13 +103,13 @@ public function readTransaction(callable $tsxHandler, ?TransactionConfiguration
105103
*
106104
* @return HandlerResult
107105
*/
108-
#[Override]
106+
#[\Override]
109107
public function transaction(callable $tsxHandler, ?TransactionConfiguration $config = null)
110108
{
111109
return $this->writeTransaction($tsxHandler, $config);
112110
}
113111

114-
#[Override]
112+
#[\Override]
115113
public function getLastBookmark(): Bookmark
116114
{
117115
return $this->session->getLastBookmark();

0 commit comments

Comments
 (0)