3
3
namespace Akaunting \Money ;
4
4
5
5
use Akaunting \Money \Casts \MoneyCast ;
6
+ use Akaunting \Money \Exceptions \UnexpectedAmountException ;
6
7
use BadFunctionCallException ;
7
8
use Closure ;
8
9
use Illuminate \Contracts \Database \Eloquent \Castable ;
13
14
use InvalidArgumentException ;
14
15
use JsonSerializable ;
15
16
use OutOfBoundsException ;
16
- use UnexpectedValueException ;
17
17
18
18
/**
19
19
* Class Money.
@@ -204,7 +204,7 @@ class Money implements Arrayable, Castable, Jsonable, JsonSerializable, Renderab
204
204
/**
205
205
* Create a new instance.
206
206
*
207
- * @throws UnexpectedValueException
207
+ * @throws UnexpectedAmountException
208
208
*/
209
209
public function __construct (mixed $ amount , Currency $ currency , bool $ convert = false )
210
210
{
@@ -215,7 +215,7 @@ public function __construct(mixed $amount, Currency $currency, bool $convert = f
215
215
/**
216
216
* parseAmount.
217
217
*
218
- * @throws UnexpectedValueException
218
+ * @throws UnexpectedAmountException
219
219
*/
220
220
protected function parseAmount (mixed $ amount , bool $ convert = false ): int |float
221
221
{
@@ -234,7 +234,7 @@ protected function parseAmount(mixed $amount, bool $convert = false): int|float
234
234
return $ this ->convertAmount ($ amount ->getAmount (), $ convert );
235
235
}
236
236
237
- throw new UnexpectedValueException ('Invalid amount " ' . $ amount . '" ' );
237
+ throw new UnexpectedAmountException ('Invalid amount " ' . $ amount . '" ' );
238
238
}
239
239
240
240
protected function parseAmountFromCallable (mixed $ amount ): mixed
0 commit comments