for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace VideoGamesRecords\DwhBundle\DataProvider;
use VideoGamesRecords\DwhBundle\Contracts\Strategy\CoreStrategyInterface;
class CoreProvider
{
/** @var CoreStrategyInterface[] */
private array $strategies = [];
public function getStrategy(string $name): CoreStrategyInterface
foreach ($this->strategies as $strategy) {
if ($strategy->supports($name)) {
return $strategy;
}
throw new \DomainException(sprintf('Unable to find a strategy to type [%s]', $name));
/**
* @param CoreStrategyInterface $strategy
*/
public function addStrategy(CoreStrategyInterface $strategy): void
$this->strategies[] = $strategy;