Skip to content

Commit 7366da5

Browse files
committed
Fixed some phpstan errors
1 parent 153e4ca commit 7366da5

File tree

6 files changed

+12
-25
lines changed

6 files changed

+12
-25
lines changed

src/Builder/ConditionalLoader.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
3+
declare(strict_types=1);
24

35
namespace Kiboko\Plugin\SQL\Builder;
46

@@ -159,11 +161,12 @@ class: new Node\Name\FullyQualified('Kiboko\Component\Flow\SQL\ConditionalLoader
159161
),
160162
$this->afterQueries ? new Node\Arg(
161163
value: $this->compileAfterQueries()
162-
): new Node\Expr\Array_(
164+
) : new Node\Expr\Array_(
163165
attributes: [
164166
'kind' => Node\Expr\Array_::KIND_SHORT
165167
],
166168
),
169+
new Node\Arg(value: $this->logger ?? new Node\Expr\New_(new Node\Name\FullyQualified('Psr\\Log\\NullLogger'))),
167170
],
168171
);
169172
}

src/Builder/ConditionalLookup.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
3+
declare(strict_types=1);
24

35
namespace Kiboko\Plugin\SQL\Builder;
46

@@ -243,6 +245,7 @@ class: new Node\Name\FullyQualified('Psr\Log\NullLogger')
243245
new Node\Arg(
244246
value: $this->compileAfterQueries()
245247
),
248+
new Node\Arg(value: $this->logger ?? new Node\Expr\New_(new Node\Name\FullyQualified('Psr\\Log\\NullLogger'))),
246249
],
247250
);
248251
}

src/Builder/Connection.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
3+
declare(strict_types=1);
24

35
namespace Kiboko\Plugin\SQL\Builder;
46

@@ -7,19 +9,13 @@
79

810
final class Connection implements Builder
911
{
10-
private ?Node\Expr $logger;
11-
private ?Node\Expr $rejection;
12-
private ?Node\Expr $state;
1312
private ?bool $persistentConnection;
1413

1514
public function __construct(
1615
private Node\Expr $dsn,
1716
private ?Node\Expr $username = null,
1817
private ?Node\Expr $password = null
1918
) {
20-
$this->logger = null;
21-
$this->rejection = null;
22-
$this->state = null;
2319
$this->persistentConnection = null;
2420
}
2521

src/Factory/Repository/Extractor.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,8 @@ class Extractor implements StepRepositoryInterface
1212
{
1313
use RepositoryTrait;
1414

15-
private Node\Expr\Variable $connectionVariable;
16-
1715
public function __construct(private SQL\Builder\Extractor $builder)
1816
{
19-
$this->files = [];
20-
$this->packages = [];
21-
$this->connectionVariable = variable('connection');
2217
}
2318

2419
public function withConnection(Connection $connection): self

src/Factory/Repository/Loader.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,8 @@ class Loader implements StepRepositoryInterface
1212
{
1313
use RepositoryTrait;
1414

15-
private Node\Expr\Variable $connectionVariable;
16-
1715
public function __construct(private SQL\Builder\Loader|SQL\Builder\ConditionalLoader $builder)
1816
{
19-
$this->files = [];
20-
$this->packages = [];
21-
$this->connectionVariable = variable('connection');
2217
}
2318

2419
public function withConnection(Connection $connection): self

src/Factory/Repository/Lookup.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,8 @@ class Lookup implements StepRepositoryInterface
1212
{
1313
use RepositoryTrait;
1414

15-
private Node\Expr\Variable $connectionVariable;
16-
1715
public function __construct(private SQL\Builder\Lookup|SQL\Builder\ConditionalLookup $builder)
1816
{
19-
$this->files = [];
20-
$this->packages = [];
21-
$this->connectionVariable = variable('connection');
2217
}
2318

2419
public function withConnection(Connection $connection): self

0 commit comments

Comments
 (0)