1 | <?php |
||
23 | abstract class AbstractUnit implements UnitInterface |
||
24 | { |
||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $name; |
||
29 | |||
30 | /** |
||
31 | * @var ConverterInterface |
||
32 | */ |
||
33 | 3 | private $converter; |
|
34 | |||
35 | 3 | private function __construct($name, ConverterInterface $converter) |
|
40 | |||
41 | 4 | private function getConverter() |
|
45 | |||
46 | /** |
||
47 | 4 | * {@inheritdoc} |
|
48 | */ |
||
49 | 4 | final public function getName() |
|
53 | |||
54 | /** |
||
55 | 2 | * {@inheritdoc} |
|
56 | */ |
||
57 | 2 | final public function getMeasure() |
|
61 | |||
62 | /** |
||
63 | 1 | * {@inheritdoc} |
|
64 | */ |
||
65 | 1 | final public function equals(UnitInterface $other) |
|
69 | |||
70 | /** |
||
71 | 1 | * {@inheritdoc} |
|
72 | */ |
||
73 | 1 | final public function isConvertible(UnitInterface $other) |
|
77 | |||
78 | /** |
||
79 | 1 | * {@inheritdoc} |
|
80 | */ |
||
81 | 1 | final public function convert(UnitInterface $other, $quantity) |
|
85 | |||
86 | /** |
||
87 | * @var Unit[] |
||
88 | */ |
||
89 | 5 | protected static $units; |
|
90 | |||
91 | 5 | final public static function __callStatic($name, $args) |
|
99 | |||
100 | /** |
||
101 | * Returns converter for given unit name. |
||
102 | * The only function to change in child classes. |
||
103 | * XXX Should be defined as abstract but not supported in PHP5. |
||
104 | * @param string $name |
||
105 | * @return ConverterInterface |
||
106 | */ |
||
107 | protected static function findConverter($name) |
||
111 | } |
||
112 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.