1 <?php
2 namespace Elboletaire\Watimage\Exception;
3
4 class InvalidArgumentException extends \Exception
5 {
6 public function __construct($message, $args = null, $code = 0, \Exception $previous = null)
7 {
8 if (!empty($args)) {
9 if (is_array($args)) {
10 $args = json_encode($args);
11 }
12 $message = sprintf($message, $args);
13 }
14
15 return parent::__construct($message, $code, $previous);
16 }
17 }
18