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