/** * Constructs a new block-size exception for the specified archive. * * @param string $archiveName * @param string $msg */ public function __construct($archiveName, $msg = null) { $default = "The archive '{$archiveName}' has an invalid block size."; if ($msg !== null) { $default .= " {$msg}"; } parent::__construct($default); }
/** * Construct an archive exception. * * If $expectedValue is provided then it will be included in the exception * message thrown. * * @param mixed $value * @param mixed $expectedValue */ public function __construct($value, $expectedValue = null) { $type = gettype($value); if (in_array($type, array('array', 'object', 'resource'))) { $value = serialize($value); } $msg = "The value '{$value}' is incorrect."; if ($expectedValue) { $msg .= " Allowed values are: " . $expectedValue . '.'; } parent::__construct($msg); }
/** * Construct an internal archive exception. * * @param string $message */ public function __construct($message) { parent::__construct("Internal error: " . $message); }
/** * Constructs a new entry prefix exception for the specified file entry. * * @param string $prefix * @param string $fileName */ public function __construct($prefix, $fileName) { parent::__construct("The prefix '{$prefix}' from the file entry '{$fileName}' is invalid."); }
/** * Constructs a new checksum exception for the specified file. * * @param string $file */ public function __construct($file) { parent::__construct("The checksum of the file '{$file}' is invalid."); }
/** * Constructs a new IO exception. * * @param string $message */ public function __construct($message) { parent::__construct($message); }
/** * Constructs a new exception for empty archive. */ public function __construct() { parent::__construct("The archive is empty."); }
/** * Constructs a new unknown type exception for the specified archive. * * @param string $archiveName */ public function __construct($archiveName) { parent::__construct("The type of the archive '{$archiveName}' cannot be determined."); }