1 | <?php |
||
24 | abstract class AbstractUnit implements UnitInterface |
||
25 | { |
||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | private $name; |
||
30 | |||
31 | /** |
||
32 | * @var ConverterInterface |
||
33 | */ |
||
34 | private $converter; |
||
35 | 3 | ||
36 | private function __construct($name, ConverterInterface $converter) |
||
41 | 8 | ||
42 | private function getConverter() |
||
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | 8 | */ |
|
50 | final public function getName() |
||
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | 3 | */ |
|
58 | final public function getMeasure() |
||
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | 2 | */ |
|
66 | final public function getCalculator() |
||
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | 1 | */ |
|
74 | final public function equals(UnitInterface $other) |
||
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | 2 | */ |
|
82 | final public function isConvertible(UnitInterface $other) |
||
86 | |||
87 | /** |
||
88 | * {@inheritdoc} |
||
89 | 4 | */ |
|
90 | final public function convert(UnitInterface $other, $quantity) |
||
94 | |||
95 | /** |
||
96 | * @var Unit[] |
||
97 | */ |
||
98 | protected static $units; |
||
99 | 11 | ||
100 | final public static function __callStatic($name, $args) |
||
108 | |||
109 | /** |
||
110 | * Returns converter for given unit name. |
||
111 | * The only function to change in child classes. |
||
112 | * XXX Should be defined as abstract but not supported in PHP5. |
||
113 | * @param string $name |
||
114 | * @return ConverterInterface |
||
115 | * @throws InvalidConfigException |
||
116 | */ |
||
117 | protected static function findConverter($name) |
||
121 | } |
||
122 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.