| 1: | <?php declare(strict_types=1); |
| 2: | |
| 3: | namespace Salient\Utility\Exception; |
| 4: | |
| 5: | use Salient\Utility\Get; |
| 6: | use InvalidArgumentException; |
| 7: | |
| 8: | |
| 9: | |
| 10: | |
| 11: | class InvalidArgumentTypeException extends InvalidArgumentException |
| 12: | { |
| 13: | |
| 14: | |
| 15: | |
| 16: | |
| 17: | |
| 18: | |
| 19: | |
| 20: | |
| 21: | public function __construct(int $number, string $name, string $type, $value) |
| 22: | { |
| 23: | parent::__construct(sprintf( |
| 24: | 'Argument #%d ($%s) must be of type %s, %s given', |
| 25: | $number, |
| 26: | ltrim($name, '$'), |
| 27: | $type, |
| 28: | Get::type($value), |
| 29: | )); |
| 30: | } |
| 31: | } |
| 32: | |