@@ -19,9 +19,9 @@ class Money
1919 /** 
2020 * Amount 
2121 * 
22-  * @var int  
22+  * @var float  
2323 */ 
24-  private  int  $ amount ;
24+  private  float  $ amount ;
2525 /** 
2626 * Currency 
2727 * 
@@ -30,10 +30,10 @@ class Money
3030 private  Currency   $ currency ;
3131
3232 /** 
33-  * @param int  $amount 
33+  * @param float  $amount 
3434 * @param Currency $currency 
3535 */ 
36-  public  function  __construct (int  $ amount , Currency   $ currency )
36+  public  function  __construct (float  $ amount , Currency   $ currency )
3737 {
3838 $ this  ->amount  = $ amount ;
3939 $ this  ->currency  = $ currency ;
@@ -43,20 +43,20 @@ public function __construct(int $amount, Currency $currency)
4343 * Add an integer quantity to the amount and returns a new Money object. 
4444 * Use a negative quantity for subtraction. 
4545 * 
46-  * @param int  $quantity quantity to add 
46+  * @param float  $quantity quantity to add 
4747 * 
4848 * @return Money 
4949 */ 
50-  public  function  add (int  $ quantity ): Money 
50+  public  function  add (float  $ quantity ): Money 
5151 {
5252 $ amount  = $ this  ->getAmount () + $ quantity ;
5353 return  new  static ($ amount , $ this  ->getCurrency ());
5454 }
5555
5656 /** 
57-  * @return int  
57+  * @return float  
5858 */ 
59-  public  function  getAmount (): int 
59+  public  function  getAmount (): float 
6060 {
6161 return  $ this  ->amount ;
6262 }
0 commit comments