| Total Complexity | 5 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class Bucket { |
||
| 11 | |||
| 12 | private string $identifier; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var Banner[] |
||
| 16 | */ |
||
| 17 | private array $banners = []; |
||
| 18 | |||
| 19 | 5 | public function __construct( string $identifier, Banner $firstBanner, Banner ...$additionalBanners ) { |
|
| 20 | 5 | $this->identifier = $identifier; |
|
| 21 | 5 | $this->banners = array_merge( [ $firstBanner ], $additionalBanners ); |
|
| 22 | } |
||
| 23 | |||
| 24 | 1 | public function getIdentifier(): string { |
|
| 25 | 1 | return $this->identifier; |
|
| 26 | } |
||
| 27 | |||
| 28 | 1 | private function getLastBanner(): Banner { |
|
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Decides which banner to return based on visitor's impression count |
||
| 34 | * |
||
| 35 | * @param int $visitorImpressionCount |
||
| 36 | * |
||
| 37 | * @return string |
||
| 38 | */ |
||
| 39 | 4 | public function getBanner( int $visitorImpressionCount ): string { |
|
| 44 | } |
||
| 45 | } |
||
| 46 |