| Total Complexity | 6 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Coverage | 25% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class TypeSemantics |
||
| 9 | { |
||
| 10 | private const MONTHLY = 'monthly'; |
||
| 11 | private const OVERUSE = 'overuse'; |
||
| 12 | private const DISCOUNT = 'discount'; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * // TODO: Probably not the best place for this method |
||
| 16 | * |
||
| 17 | * @return TypeInterface |
||
| 18 | */ |
||
| 19 | public function createMonthlyType(): TypeInterface |
||
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param TypeInterface $type |
||
| 26 | * @return bool |
||
| 27 | */ |
||
| 28 | public function isMonthly(TypeInterface $type): bool |
||
| 29 | { |
||
| 30 | return $this->groupName($type) === self::MONTHLY; |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @param TypeInterface $type |
||
| 35 | * @return bool |
||
| 36 | 6 | */ |
|
| 37 | public function isDiscount(TypeInterface $type): bool |
||
| 38 | 6 | { |
|
| 39 | return $this->groupName($type) === self::DISCOUNT; |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @param TypeInterface $type |
||
| 44 | * @return bool |
||
| 45 | */ |
||
| 46 | public function isOveruse(TypeInterface $type): bool |
||
| 47 | { |
||
| 48 | return $this->groupName($type) === self::OVERUSE; |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @param TypeInterface $type |
||
| 53 | * @return string |
||
| 54 | */ |
||
| 55 | public function groupName(TypeInterface $type): string |
||
| 63 | 6 | } |
|
| 64 | } |
||
| 65 |