1 | <?php |
||
14 | class Converter |
||
15 | { |
||
16 | /** |
||
17 | * @var Converter |
||
18 | */ |
||
19 | private static $instance; |
||
20 | |||
21 | /** |
||
22 | * Create a new Converter object that you can later get through "::get()" |
||
23 | * @param SourceInterface $source |
||
24 | */ |
||
25 | 1 | public static function initialize(SourceInterface $source) |
|
29 | |||
30 | /** |
||
31 | * @return Converter |
||
32 | */ |
||
33 | 2 | public static function get() |
|
41 | |||
42 | /** |
||
43 | * Clear the object, returned through "::get" |
||
44 | */ |
||
45 | 1 | public static function clear() |
|
49 | |||
50 | /** |
||
51 | * @var SourceInterface |
||
52 | */ |
||
53 | private $source; |
||
54 | |||
55 | 1 | public function __construct(SourceInterface $source) |
|
59 | |||
60 | /** |
||
61 | * @return SourceInterface |
||
62 | */ |
||
63 | 1 | public function getSource() |
|
67 | |||
68 | /** |
||
69 | * @param Money $money |
||
70 | * @param Currency $to |
||
71 | * @param int $roundingMode |
||
72 | * @return Money |
||
73 | */ |
||
74 | 1 | public function convert(Money $money, Currency $to, $roundingMode = PHP_ROUND_HALF_UP) |
|
82 | } |
||
83 |