Skip to content

Commit 6068ebb

Browse files
committed
Lint and fix
1 parent b842625 commit 6068ebb

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

.phpcs-cache

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/Strategy/AbstractStrategy.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ abstract class AbstractStrategy implements StrategyInterface
2020
* @var array<string, mixed>
2121
*/
2222
protected array $options = [];
23-
23+
2424
/**
2525
* Configure the strategy with optional parameters
2626
*
@@ -30,7 +30,7 @@ public function configure(array $options = []): void
3030
{
3131
$this->options = array_merge($this->options, $options);
3232
}
33-
33+
3434
/**
3535
* Default validation implementation that always returns true
3636
* Override this method in concrete strategies to implement specific validation logic
@@ -42,7 +42,7 @@ public function validate(array $data): bool
4242
{
4343
return true;
4444
}
45-
45+
4646
/**
4747
* Determine if this strategy can handle the given data
4848
*

src/Strategy/StrategyContext.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class StrategyContext
2828
* Default strategy to use when no other strategy matches
2929
*/
3030
private ?StrategyInterface $defaultStrategy = null;
31-
31+
3232
/**
3333
* Add a strategy with optional configuration
3434
*
@@ -42,7 +42,7 @@ public function addStrategy(StrategyInterface $strategy, array $config = []): se
4242
$this->strategies[] = $strategy;
4343
return $this;
4444
}
45-
45+
4646
/**
4747
* Set a default strategy to use when no other strategy matches
4848
*
@@ -54,7 +54,7 @@ public function setDefaultStrategy(StrategyInterface $strategy): self
5454
$this->defaultStrategy = $strategy;
5555
return $this;
5656
}
57-
57+
5858
/**
5959
* Execute the appropriate strategy for the given data
6060
*
@@ -65,14 +65,14 @@ public function setDefaultStrategy(StrategyInterface $strategy): self
6565
public function executeStrategy(array $data): mixed
6666
{
6767
$strategy = $this->resolveStrategy($data);
68-
68+
6969
if (!$strategy->validate($data)) {
7070
throw new RuntimeException('Invalid data for strategy execution');
7171
}
72-
72+
7373
return $strategy->execute($data);
7474
}
75-
75+
7676
/**
7777
* Find the first strategy that supports the given data
7878
*
@@ -87,11 +87,11 @@ private function resolveStrategy(array $data): StrategyInterface
8787
return $strategy;
8888
}
8989
}
90-
90+
9191
if ($this->defaultStrategy !== null) {
9292
return $this->defaultStrategy;
9393
}
94-
94+
9595
throw new RuntimeException('No suitable strategy found for the given data');
9696
}
9797
}

src/Traits/ConfigurableStrategyTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ trait ConfigurableStrategyTrait
2626
* @var string[]
2727
*/
2828
protected array $requiredOptions = [];
29-
29+
3030
/**
3131
* Configure the strategy with options
3232
*
@@ -38,7 +38,7 @@ public function configure(array $options = []): void
3838
$this->validateOptions($options);
3939
$this->options = array_merge($this->options, $options);
4040
}
41-
41+
4242
/**
4343
* Validate that all required options are present
4444
*
@@ -54,7 +54,7 @@ protected function validateOptions(array $options): void
5454
);
5555
}
5656
}
57-
57+
5858
/**
5959
* Get an option value with a default fallback
6060
*

0 commit comments

Comments
 (0)