PHP Classes

File: docs/files/Exception/InvalidCurrencyException.php.txt

Recommend this page to a friend!
  Classes of Temuri Takalandze   PHP NBG Currency   docs/files/Exception/InvalidCurrencyException.php.txt   Download  
File: docs/files/Exception/InvalidCurrencyException.php.txt
Role: Documentation
Content type: text/plain
Description: Documentation
Class: PHP NBG Currency
Get currency values from National Bank of Georgia
Author: By
Last change:
Date: 3 years ago
Size: 1,257 bytes
 

Contents

Class file image Download
<?php /** * Class InvalidCurrencyException | src/Exception/InvalidCurrencyException.php * * @category Exception * @package ABGEO\NBG\Exception * @author Temuri Takalandze <takalandzet@gmail.com> * @license MIT https://github.com/ABGEO07/nbg-currency/blob/master/LICENSE * @link https://github.com/ABGEO07/nbg-currency */ namespace ABGEO\NBG\Exception; use Exception; /** * Class InvalidCurrencyException * @package ABGEO\NBG\Exception */ class InvalidCurrencyException extends Exception { /** * InvalidCurrencyException constructor. * * @param string $currency Invalid currency code. * @param int $code [optional] The Exception code. * @param Exception $previous [optional] The previous throwable * used for the exception chaining. */ public function __construct($currency, $code = 0, Exception $previous = null) { $message = 'Currency "' . $currency . '" does not exists!'; parent::__construct($message, $code, $previous); } /** * Convert exception to string. * * @return string */ public function __toString() { return __CLASS__ . ": [{$this->code}]: {$this->message}\n"; } }