-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Psalm to 4.9.2, fix reported issue
- Loading branch information
Showing
2 changed files
with
43 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Brick\Money\Exception; | ||
|
||
/** | ||
* Exception thrown when attempting to create a Currency from an unknown currency code. | ||
*/ | ||
class UnknownCurrencyException extends MoneyException | ||
{ | ||
/** | ||
* @param string|int $currencyCode | ||
* | ||
* @return UnknownCurrencyException | ||
*/ | ||
public static function unknownCurrency($currencyCode) : self | ||
{ | ||
return new self('Unknown currency code: ' . $currencyCode); | ||
} | ||
|
||
/** | ||
* @param string $countryCode | ||
* | ||
* @return UnknownCurrencyException | ||
*/ | ||
public static function noCurrencyForCountry(string $countryCode) : self | ||
{ | ||
return new self('No currency found for country ' . $countryCode); | ||
} | ||
|
||
/** | ||
* @param string $countryCode | ||
* @param array $currencyCodes | ||
* | ||
* @return UnknownCurrencyException | ||
*/ | ||
public static function noSingleCurrencyForCountry(string $countryCode, array $currencyCodes) : self | ||
{ | ||
return new self('No single currency for country ' . $countryCode . ': ' . implode(', ', $currencyCodes)); | ||
} | ||
} | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Brick\Money\Exception; | ||
|
||
/** | ||
* Exception thrown when attempting to create a Currency from an unknown currency code. | ||
*/ | ||
class UnknownCurrencyException extends MoneyException | ||
{ | ||
/** | ||
* @param string|int $currencyCode | ||
* | ||
* @return UnknownCurrencyException | ||
*/ | ||
public static function unknownCurrency($currencyCode) : self | ||
{ | ||
return new self('Unknown currency code: ' . $currencyCode); | ||
} | ||
|
||
/** | ||
* @param string $countryCode | ||
* | ||
* @return UnknownCurrencyException | ||
*/ | ||
public static function noCurrencyForCountry(string $countryCode) : self | ||
{ | ||
return new self('No currency found for country ' . $countryCode); | ||
} | ||
|
||
/** | ||
* @param string $countryCode | ||
* @param string[] $currencyCodes | ||
* | ||
* @return UnknownCurrencyException | ||
*/ | ||
public static function noSingleCurrencyForCountry(string $countryCode, array $currencyCodes) : self | ||
{ | ||
return new self('No single currency for country ' . $countryCode . ': ' . implode(', ', $currencyCodes)); | ||
} | ||
} |