| Total Complexity | 10 |
| Total Lines | 61 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class Campaign { |
||
| 11 | |||
| 12 | private $identifier; |
||
| 13 | private $start; |
||
| 14 | private $end; |
||
| 15 | private $category; |
||
| 16 | private $rng; |
||
| 17 | private $displayPercentage; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var Bucket[] |
||
| 21 | */ |
||
| 22 | private $buckets; |
||
| 23 | 6 | ||
| 24 | public function __construct( |
||
| 25 | string $identifier, |
||
| 26 | \DateTime $start, |
||
| 27 | \DateTime $end, |
||
| 28 | int $displayPercentage, |
||
| 29 | string $category, |
||
| 30 | RandomIntegerGenerator $rng, |
||
| 31 | Bucket $firstBucket, |
||
| 32 | 6 | Bucket ...$additionalBuckets ) { |
|
| 33 | 6 | ||
| 34 | 6 | $this->identifier = $identifier; |
|
| 35 | 6 | $this->start = $start; |
|
| 36 | 6 | $this->end = $end; |
|
| 37 | 6 | $this->category = $category; |
|
| 38 | 6 | $this->displayPercentage = $displayPercentage; |
|
| 39 | $this->rng = $rng; |
||
| 40 | 1 | $this->buckets = array_merge( [$firstBucket], $additionalBuckets ); |
|
| 41 | 1 | } |
|
| 42 | |||
| 43 | public function getIdentifier(): string { |
||
| 44 | 1 | return $this->identifier; |
|
| 45 | 1 | } |
|
| 46 | |||
| 47 | public function getEnd(): \DateTime { |
||
| 49 | 2 | } |
|
| 50 | 2 | ||
| 51 | public function getCategory(): string { |
||
| 52 | return $this->category; |
||
| 53 | 3 | } |
|
| 54 | 3 | ||
| 55 | 3 | public function isInActiveDateRange( \DateTime $time ): bool { |
|
| 58 | } |
||
| 59 | 2 | ||
| 60 | public function selectBucket( ?string $bucketId ): Bucket { |
||
| 67 | } |
||
| 68 | |||
| 69 | public function getDisplayPercentage(): int { |
||
| 71 | } |
||
| 72 | } |