Skip to content

Commit 1810aeb

Browse files
committed
Fixed "Property is never read, only written" + made abstract class
1 parent 3d9f25f commit 1810aeb

File tree

9 files changed

+7
-34
lines changed

9 files changed

+7
-34
lines changed

src/Builder/Extractor.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
final class Extractor implements StepBuilderInterface
1111
{
1212
private ?Node\Expr $logger;
13-
private ?Node\Expr $rejection;
14-
private ?Node\Expr $state;
1513

1614
public function __construct(
1715
private ?Node\Expr $filePath,
@@ -22,8 +20,6 @@ public function __construct(
2220
private bool $safeMode = true,
2321
) {
2422
$this->logger = null;
25-
$this->rejection = null;
26-
$this->state = null;
2723
}
2824

2925
public function withFilePath(Node\Expr $filePath): self
@@ -70,15 +66,11 @@ public function withLogger(Node\Expr $logger): self
7066

7167
public function withRejection(Node\Expr $rejection): self
7268
{
73-
$this->rejection = $rejection;
74-
7569
return $this;
7670
}
7771

7872
public function withState(Node\Expr $state): self
7973
{
80-
$this->state = $state;
81-
8274
return $this;
8375
}
8476

src/Builder/Loader.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
final class Loader implements StepBuilderInterface
1111
{
1212
private ?Node\Expr $logger;
13-
private ?Node\Expr $rejection;
14-
private ?Node\Expr $state;
1513

1614
public function __construct(
1715
private ?Node\Expr $filePath,
@@ -22,8 +20,6 @@ public function __construct(
2220
private bool $safeMode = true,
2321
) {
2422
$this->logger = null;
25-
$this->rejection = null;
26-
$this->state = null;
2723
}
2824

2925
public function withFilePath(Node\Expr $filePath): self
@@ -70,15 +66,11 @@ public function withLogger(Node\Expr $logger): self
7066

7167
public function withRejection(Node\Expr $rejection): self
7268
{
73-
$this->rejection = $rejection;
74-
7569
return $this;
7670
}
7771

7872
public function withState(Node\Expr $state): self
7973
{
80-
$this->state = $state;
81-
8274
return $this;
8375
}
8476

src/Builder/MultipleFilesLoader.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
final class MultipleFilesLoader implements StepBuilderInterface
1111
{
1212
private ?Node\Expr $logger;
13-
private ?Node\Expr $rejection;
14-
private ?Node\Expr $state;
1513

1614
public function __construct(
1715
private ?Node\Expr $filePath,
@@ -23,8 +21,6 @@ public function __construct(
2321
private bool $safeMode = true,
2422
) {
2523
$this->logger = null;
26-
$this->rejection = null;
27-
$this->state = null;
2824
}
2925

3026
public function withFilePath(Node\Expr $filePath): self
@@ -34,13 +30,6 @@ public function withFilePath(Node\Expr $filePath): self
3430
return $this;
3531
}
3632

37-
public function withPattern(Node\Expr $pattern): self
38-
{
39-
$this->pattern = $pattern;
40-
41-
return $this;
42-
}
43-
4433
public function withMaxLines(Node\Expr $maxLines): self
4534
{
4635
$this->maxLines = $maxLines;
@@ -85,15 +74,11 @@ public function withLogger(Node\Expr $logger): self
8574

8675
public function withRejection(Node\Expr $rejection): self
8776
{
88-
$this->rejection = $rejection;
89-
9077
return $this;
9178
}
9279

9380
public function withState(Node\Expr $state): self
9481
{
95-
$this->state = $state;
96-
9782
return $this;
9883
}
9984

src/Configuration.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ public function getConfigTreeBuilder(): TreeBuilder
1515
$loader = new Configuration\Loader();
1616

1717
$builder = new TreeBuilder('csv');
18+
19+
/* @phpstan-ignore-next-line */
1820
$builder->getRootNode()
1921
->validate()
2022
->ifTrue(function (array $value) {

src/Configuration/Extractor.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public function getConfigTreeBuilder(): TreeBuilder
1515
{
1616
$builder = new TreeBuilder('extractor');
1717

18+
/* @phpstan-ignore-next-line */
1819
$builder->getRootNode()
1920
->children()
2021
->scalarNode('file_path')

src/Configuration/Loader.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public function getConfigTreeBuilder(): TreeBuilder
1515
{
1616
$builder = new TreeBuilder('loader');
1717

18+
/* @phpstan-ignore-next-line */
1819
$builder->getRootNode()
1920
->children()
2021
->scalarNode('file_path')

tests/functional/Builder/ExtractorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Kiboko\Plugin\Log;
77
use PhpParser\Node;
88

9-
final class ExtractorTest extends BuilderTestCase
9+
abstract class ExtractorTest extends BuilderTestCase
1010
{
1111
public function testWithoutOptions(): void
1212
{

tests/functional/Builder/LoaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Kiboko\Plugin\Log;
77
use PhpParser\Node;
88

9-
final class LoaderTest extends BuilderTestCase
9+
abstract class LoaderTest extends BuilderTestCase
1010
{
1111
public function testWithoutOptions(): void
1212
{

tests/functional/Builder/MultipleFilesLoaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Vfs\FileSystem;
1010
use function Kiboko\Component\SatelliteToolbox\Configuration\compileExpression;
1111

12-
final class MultipleFilesLoaderTest extends BuilderTestCase
12+
abstract class MultipleFilesLoaderTest extends BuilderTestCase
1313
{
1414
use PipelineAssertTrait;
1515

0 commit comments

Comments
 (0)