diff --git a/composer.json b/composer.json index 5994ae7..f3c18d6 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "meritoo/common-library", "description": "Useful classes, methods, extensions etc.", "license": "MIT", - "version": "0.0.8", + "version": "0.0.9", "authors": [ { "name": "Meritoo.pl", diff --git a/src/Meritoo/Common/Exception/File/EmptyFileException.php b/src/Meritoo/Common/Exception/File/EmptyFileException.php new file mode 100644 index 0000000..14734d7 --- /dev/null +++ b/src/Meritoo/Common/Exception/File/EmptyFileException.php @@ -0,0 +1,31 @@ + + * @copyright Meritoo.pl + */ +class EmptyFileException extends \Exception +{ + /** + * Class constructor + * + * @param string $emptyFilePath Path of the empty file + */ + public function __construct($emptyFilePath) + { + $template = 'File with path \'%s\' is empty (has no content). Did you provide path of proper file?'; + $message = sprintf($template, $emptyFilePath); + + parent::__construct($message); + } +} diff --git a/src/Meritoo/Common/Exception/File/EmptyFilePathException.php b/src/Meritoo/Common/Exception/File/EmptyFilePathException.php new file mode 100644 index 0000000..5f80e6b --- /dev/null +++ b/src/Meritoo/Common/Exception/File/EmptyFilePathException.php @@ -0,0 +1,26 @@ + + * @copyright Meritoo.pl + */ +class EmptyFilePathException extends \Exception +{ + /** + * Class constructor + */ + public function __construct() + { + parent::__construct('Path of the file is empty. Did you provide path of proper file?'); + } +} diff --git a/src/Meritoo/Common/Exception/File/NotExistingFileException.php b/src/Meritoo/Common/Exception/File/NotExistingFileException.php new file mode 100644 index 0000000..d870881 --- /dev/null +++ b/src/Meritoo/Common/Exception/File/NotExistingFileException.php @@ -0,0 +1,31 @@ + + * @copyright Meritoo.pl + */ +class NotExistingFileException extends \Exception +{ + /** + * Class constructor + * + * @param string $notExistingFilePath Path of not existing (or not readable) file + */ + public function __construct($notExistingFilePath) + { + $template = 'File with path \'%s\' does not exist (or is not readable). Did you provide proper path of file?'; + $message = sprintf($template, $notExistingFilePath); + + parent::__construct($message); + } +}