Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
3 / 3 |
ProviderFinder | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |
100.00% |
3 / 3 |
findById | |
100.00% |
1 / 1 |
2 | |
100.00% |
3 / 3 |
<?php | |
namespace Alxvng\QATracker\DataProvider\Finder; | |
use Alxvng\QATracker\DataProvider\Model\AbstractDataSerie; | |
class ProviderFinder | |
{ | |
public static function findById(string $id, array $providersStack): AbstractDataSerie | |
{ | |
if (!isset($providersStack[$id])) { | |
throw new \RuntimeException(sprintf('Unable to find data serie for id "%s"', $id, )); | |
} | |
return $providersStack[$id]; | |
} | |
} |