Skip to content

Commit b802e51

Browse files
committed
use rector
1 parent ae4c897 commit b802e51

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+256
-230
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
"symfony/uid": "^5.0",
5656
"symfony/var-dumper": "^5.0",
5757
"cache/integration-tests": "dev-master",
58-
"kubawerlos/php-cs-fixer-custom-fixers": "3.13.*"
58+
"kubawerlos/php-cs-fixer-custom-fixers": "3.13.*",
59+
"rector/rector": "^1.0"
5960
},
6061
"autoload": {
6162
"psr-4": {

rector.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file is part of the Neo4j PHP Client and Driver package.
7+
*
8+
* (c) Nagels <https://nagels.tech>
9+
*
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
12+
*/
13+
14+
use Rector\Config\RectorConfig;
15+
use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector;
16+
17+
return RectorConfig::configure()
18+
->withPaths([
19+
__DIR__.'/src',
20+
__DIR__.'/tests',
21+
])
22+
->withPhpSets(php81: true)
23+
->withRules([
24+
AddVoidReturnTypeWhereNoReturnRector::class,
25+
]);

src/Authentication/BasicAuth.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ final class BasicAuth implements AuthenticateInterface
3434
* @psalm-external-mutation-free
3535
*/
3636
public function __construct(
37-
private string $username,
38-
private string $password
37+
private readonly string $username,
38+
private readonly string $password
3939
) {}
4040

4141
/**

src/Authentication/KerberosAuth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ final class KerberosAuth implements AuthenticateInterface
3333
* @psalm-external-mutation-free
3434
*/
3535
public function __construct(
36-
private string $token
36+
private readonly string $token
3737
) {}
3838

3939
/**

src/Authentication/OpenIDConnectAuth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class OpenIDConnectAuth implements AuthenticateInterface
3030
* @psalm-external-mutation-free
3131
*/
3232
public function __construct(
33-
private string $token
33+
private readonly string $token
3434
) {}
3535

3636
/**

src/Basic/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class Client implements ClientInterface
2929
* @param ClientInterface<SummarizedResult<CypherMap>> $client
3030
*/
3131
public function __construct(
32-
private ClientInterface $client
32+
private readonly ClientInterface $client
3333
) {}
3434

3535
public function run(string $statement, iterable $parameters = [], ?string $alias = null): SummarizedResult

src/Basic/Driver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class Driver implements DriverInterface
3434
* @psalm-external-mutation-free
3535
*/
3636
public function __construct(
37-
private DriverInterface $driver
37+
private readonly DriverInterface $driver
3838
) {}
3939

4040
/**

src/Basic/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class Session implements SessionInterface
3030
* @param SessionInterface<SummarizedResult<CypherMap>> $session
3131
*/
3232
public function __construct(
33-
private SessionInterface $session
33+
private readonly SessionInterface $session
3434
) {}
3535

3636
/**

src/Basic/UnmanagedTransaction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class UnmanagedTransaction implements UnmanagedTransactionInterface
2828
* @param UnmanagedTransactionInterface<SummarizedResult<CypherMap>> $tsx
2929
*/
3030
public function __construct(
31-
private UnmanagedTransactionInterface $tsx
31+
private readonly UnmanagedTransactionInterface $tsx
3232
) {}
3333

3434
/**

src/Bolt/BoltConnection.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ public function getImplementation(): array
6565
*/
6666
public function __construct(
6767
private V4_4|V5 $boltProtocol,
68-
private Connection $connection,
69-
private AuthenticateInterface $auth,
70-
private string $userAgent,
68+
private readonly Connection $connection,
69+
private readonly AuthenticateInterface $auth,
70+
private readonly string $userAgent,
7171
/** @psalm-readonly */
72-
private ConnectionConfiguration $config
72+
private readonly ConnectionConfiguration $config
7373
) {}
7474

7575
public function getEncryptionLevel(): string

0 commit comments

Comments
 (0)