| Total Complexity | 5 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Coverage | 85.71% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class Bucket { |
||
| 11 | |||
| 12 | private $identifier; |
||
| 13 | private $firstBanner; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var Banner[] |
||
| 17 | */ |
||
| 18 | private $banners = []; |
||
| 19 | |||
| 20 | 4 | public function __construct( string $identifier, Banner $firstBanner, Banner ...$otherBanners ) { |
|
| 21 | 4 | $this->identifier = $identifier; |
|
| 22 | 4 | $this->firstBanner = $firstBanner; |
|
| 23 | 4 | $this->banners[] = $firstBanner; |
|
| 24 | 4 | $this->banners = array_merge( $this->banners, $otherBanners ); |
|
| 25 | 4 | } |
|
| 26 | |||
| 27 | public function getIdentifier(): string { |
||
| 28 | 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 | 4 | public function getBanner( int $visitorImpressionCount ): string { |
|
| 43 | } |
||
| 44 | } |