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