1 | <?php |
||
13 | class Money implements ValueObjectInterface |
||
14 | { |
||
15 | /** @var BaseMoney */ |
||
16 | protected $money; |
||
17 | |||
18 | /** @var Currency */ |
||
19 | protected $currency; |
||
20 | |||
21 | /** |
||
22 | * Returns a Money object from native int amount and string currency code |
||
23 | * |
||
24 | * @param int $amount Amount expressed in the smallest units of $currency (e.g. cents) |
||
|
|||
25 | * @param string $currency Currency code of the money object |
||
26 | * @return static |
||
27 | */ |
||
28 | 1 | public static function fromNative() |
|
37 | |||
38 | /** |
||
39 | * Returns a Money object |
||
40 | * |
||
41 | * @param \ValueObjects\Number\Integer $amount Amount expressed in the smallest units of $currency (e.g. cents) |
||
42 | * @param Currency $currency Currency of the money object |
||
43 | */ |
||
44 | 9 | public function __construct(Integer $amount, Currency $currency) |
|
50 | |||
51 | /** |
||
52 | * Tells whether two Currency are equal by comparing their amount and currency |
||
53 | * |
||
54 | * @param ValueObjectInterface $money |
||
55 | * @return bool |
||
56 | */ |
||
57 | 2 | public function sameValueAs(ValueObjectInterface $money) |
|
65 | |||
66 | /** |
||
67 | * Returns money amount |
||
68 | * |
||
69 | * @return \ValueObjects\Number\Integer |
||
70 | */ |
||
71 | 8 | public function getAmount() |
|
77 | |||
78 | /** |
||
79 | * Returns money currency |
||
80 | * |
||
81 | * @return Currency |
||
82 | */ |
||
83 | 8 | public function getCurrency() |
|
87 | |||
88 | /** |
||
89 | * Add an integer quantity to the amount and returns a new Money object. |
||
90 | * Use a negative quantity for subtraction. |
||
91 | * |
||
92 | * @param \ValueObjects\Number\Integer $quantity Quantity to add |
||
93 | * @return Money |
||
94 | */ |
||
95 | 2 | public function add(Integer $quantity) |
|
102 | |||
103 | /** |
||
104 | * Multiply the Money amount for a given number and returns a new Money object. |
||
105 | * Use 0 < Real $multipler < 1 for division. |
||
106 | * |
||
107 | * @param Real $multiplier |
||
108 | * @param mixed $rounding_mode Rounding mode of the operation. Defaults to RoundingMode::HALF_UP. |
||
109 | * @return Money |
||
110 | */ |
||
111 | 2 | public function multiply(Real $multiplier, RoundingMode $rounding_mode = null) |
|
123 | |||
124 | /** |
||
125 | * Returns a string representation of the Money value in format "CUR AMOUNT" (e.g.: EUR 1000) |
||
126 | * |
||
127 | * @return string |
||
128 | */ |
||
129 | 1 | public function __toString() |
|
133 | } |
||
134 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.