add type to WrongFiletypeException
This commit is contained in:
parent
1a11d220a9
commit
992ce8a37c
3 changed files with 29 additions and 5 deletions
|
|
@ -30,7 +30,14 @@
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
const MESSAGE = 'File has wrong type';
|
||||
const MESSAGE = 'File has wrong type “%s”';
|
||||
|
||||
/**
|
||||
* Type of file
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $type;
|
||||
|
||||
|
||||
|
||||
|
|
@ -38,12 +45,29 @@
|
|||
/**
|
||||
* Construct a new exception.
|
||||
*/
|
||||
function __construct($message=self::MESSAGE, $code=self::CODE)
|
||||
function __construct($type, $message=self::MESSAGE, $code=self::CODE)
|
||||
{
|
||||
parent::__construct(
|
||||
$message,
|
||||
$code
|
||||
$code,
|
||||
$type
|
||||
);
|
||||
|
||||
// Store values
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get type of file.
|
||||
*
|
||||
* @return Type of file
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue