new appraoch
This commit is contained in:
14
pancake/system/vendor/moneyphp/money/src/Exception/FormatterException.php
vendored
Executable file
14
pancake/system/vendor/moneyphp/money/src/Exception/FormatterException.php
vendored
Executable file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Money\Exception;
|
||||
|
||||
use Money\Exception;
|
||||
|
||||
/**
|
||||
* Thrown when a Money object cannot be formatted into a string.
|
||||
*
|
||||
* @author Frederik Bosch <f.bosch@genkgo.nl>
|
||||
*/
|
||||
final class FormatterException extends \RuntimeException implements Exception
|
||||
{
|
||||
}
|
||||
14
pancake/system/vendor/moneyphp/money/src/Exception/ParserException.php
vendored
Executable file
14
pancake/system/vendor/moneyphp/money/src/Exception/ParserException.php
vendored
Executable file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Money\Exception;
|
||||
|
||||
use Money\Exception;
|
||||
|
||||
/**
|
||||
* Thrown when a string cannot be parsed to a Money object.
|
||||
*
|
||||
* @author Frederik Bosch <f.bosch@genkgo.nl>
|
||||
*/
|
||||
final class ParserException extends \RuntimeException implements Exception
|
||||
{
|
||||
}
|
||||
14
pancake/system/vendor/moneyphp/money/src/Exception/UnknownCurrencyException.php
vendored
Executable file
14
pancake/system/vendor/moneyphp/money/src/Exception/UnknownCurrencyException.php
vendored
Executable file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Money\Exception;
|
||||
|
||||
use Money\Exception;
|
||||
|
||||
/**
|
||||
* Thrown when trying to get ISO currency that does not exists.
|
||||
*
|
||||
* @author Frederik Bosch <f.bosch@genkgo.nl>
|
||||
*/
|
||||
final class UnknownCurrencyException extends \DomainException implements Exception
|
||||
{
|
||||
}
|
||||
30
pancake/system/vendor/moneyphp/money/src/Exception/UnresolvableCurrencyPairException.php
vendored
Executable file
30
pancake/system/vendor/moneyphp/money/src/Exception/UnresolvableCurrencyPairException.php
vendored
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Money\Exception;
|
||||
|
||||
use Money\Currency;
|
||||
use Money\Exception;
|
||||
|
||||
/**
|
||||
* Thrown when there is no currency pair (rate) available for the given currencies.
|
||||
*
|
||||
* @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
|
||||
*/
|
||||
final class UnresolvableCurrencyPairException extends \InvalidArgumentException implements Exception
|
||||
{
|
||||
/**
|
||||
* Creates an exception from Currency objects.
|
||||
*
|
||||
* @return UnresolvableCurrencyPairException
|
||||
*/
|
||||
public static function createFromCurrencies(Currency $baseCurrency, Currency $counterCurrency)
|
||||
{
|
||||
$message = sprintf(
|
||||
'Cannot resolve a currency pair for currencies: %s/%s',
|
||||
$baseCurrency->getCode(),
|
||||
$counterCurrency->getCode()
|
||||
);
|
||||
|
||||
return new self($message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user