| Total Complexity | 7 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | final class Unit |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @uses get_name |
||
| 23 | * @uses get_long_name |
||
| 24 | * @uses get_short_name |
||
| 25 | * @uses get_narrow_name |
||
| 26 | */ |
||
| 27 | use AccessorTrait; |
||
| 28 | |||
| 29 | private function get_name(): string |
||
|
|
|||
| 30 | { |
||
| 31 | return $this->long_name; |
||
| 32 | } |
||
| 33 | |||
| 34 | private function get_long_name(): string |
||
| 35 | { |
||
| 36 | return $this->name_for(UnitLength::LONG); |
||
| 37 | } |
||
| 38 | |||
| 39 | private function get_short_name(): string |
||
| 40 | { |
||
| 41 | return $this->name_for(UnitLength::SHORT); |
||
| 42 | } |
||
| 43 | |||
| 44 | private function get_narrow_name(): string |
||
| 47 | } |
||
| 48 | |||
| 49 | public function __construct( |
||
| 50 | private readonly Units $units, |
||
| 51 | private readonly string $unit |
||
| 52 | ) { |
||
| 53 | } |
||
| 54 | |||
| 55 | public function __toString(): string |
||
| 56 | { |
||
| 57 | return $this->unit; |
||
| 58 | } |
||
| 59 | |||
| 60 | private function name_for(UnitLength $length): string |
||
| 63 | } |
||
| 64 | } |
||
| 65 |
This check looks for private methods that have been defined, but are not used inside the class.