Skip to content

Commit

Permalink
Update Psalm to 4.9.2, fix reported issue
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Aug 2, 2021
1 parent 7b196ed commit 5e7af32
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"brick/varexporter": "~0.2.1",
"php-coveralls/php-coveralls": "^2.2",
"phpunit/phpunit": "^7.5.15 || ^8.0 || ^9.0",
"vimeo/psalm": "4.7.3"
"vimeo/psalm": "4.9.2"
},
"suggest": {
"ext-intl": "Required to format Money objects"
Expand Down
84 changes: 42 additions & 42 deletions src/Exception/UnknownCurrencyException.php
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));
}
}

0 comments on commit 5e7af32

Please sign in to comment.