From 3bb159161d180dd4c9a9d404f40bd77e855d56c4 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sat, 4 Mar 2017 23:15:22 +0100 Subject: [PATCH] renamed deprecated exception name to a more common one MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../template/console/class_ConsoleTemplateEngine.php | 4 ++-- .../classes/template/html/class_HtmlTemplateEngine.php | 4 ++-- .../classes/template/image/class_ImageTemplateEngine.php | 4 ++-- .../classes/template/mail/class_MailTemplateEngine.php | 4 ++-- .../classes/template/menu/class_MenuTemplateEngine.php | 6 +++--- ...ryException.php => class_InvalidDirectoryException.php} | 7 +++---- 6 files changed, 14 insertions(+), 15 deletions(-) rename framework/main/exceptions/template/{class_BasePathIsNoDirectoryException.php => class_InvalidDirectoryException.php} (87%) diff --git a/framework/main/classes/template/console/class_ConsoleTemplateEngine.php b/framework/main/classes/template/console/class_ConsoleTemplateEngine.php index e4ca45eb..9d485c4e 100644 --- a/framework/main/classes/template/console/class_ConsoleTemplateEngine.php +++ b/framework/main/classes/template/console/class_ConsoleTemplateEngine.php @@ -48,7 +48,7 @@ class ConsoleTemplateEngine extends BaseTemplateEngine implements CompileableTem * * @return $templateInstance An instance of TemplateEngine * @throws UnexpectedValueException If the provided $templateBasePath is empty or no string - * @throws BasePathIsNoDirectoryException If $templateBasePath is no + * @throws InvalidDirectoryException If $templateBasePath is no * directory or not found * @throws BasePathReadProtectedException If $templateBasePath is * read-protected @@ -72,7 +72,7 @@ class ConsoleTemplateEngine extends BaseTemplateEngine implements CompileableTem throw new UnexpectedValueException(sprintf('[%s:%d] %s is not a string with a base path.', $templateInstance->__toString(), __LINE__, $templateBasePath), self::EXCEPTION_INVALID_STRING); } elseif (!is_dir($templateBasePath)) { // Is not a path - throw new BasePathIsNoDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME); + throw new InvalidDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME); } elseif (!is_readable($templateBasePath)) { // Is not readable throw new BasePathReadProtectedException(array($templateInstance, $templateBasePath), self::EXCEPTION_READ_PROTECED_PATH); diff --git a/framework/main/classes/template/html/class_HtmlTemplateEngine.php b/framework/main/classes/template/html/class_HtmlTemplateEngine.php index 9fd2f285..0ecfa862 100644 --- a/framework/main/classes/template/html/class_HtmlTemplateEngine.php +++ b/framework/main/classes/template/html/class_HtmlTemplateEngine.php @@ -48,7 +48,7 @@ class HtmlTemplateEngine extends BaseTemplateEngine implements CompileableTempla * * @return $templateInstance An instance of TemplateEngine * @throws UnexpectedValueException If the provided $templateBasePath is empty or no string - * @throws BasePathIsNoDirectoryException If $templateBasePath is no + * @throws InvalidDirectoryException If $templateBasePath is no * directory or not found * @throws BasePathReadProtectedException If $templateBasePath is * read-protected @@ -72,7 +72,7 @@ class HtmlTemplateEngine extends BaseTemplateEngine implements CompileableTempla throw new UnexpectedValueException(sprintf('[%s:%d] %s is not a string with a base path.', $templateInstance->__toString(), __LINE__, $templateBasePath), self::EXCEPTION_INVALID_STRING); } elseif (!is_dir($templateBasePath)) { // Is not a path - throw new BasePathIsNoDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME); + throw new InvalidDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME); } elseif (!is_readable($templateBasePath)) { // Is not readable throw new BasePathReadProtectedException(array($templateInstance, $templateBasePath), self::EXCEPTION_READ_PROTECED_PATH); diff --git a/framework/main/classes/template/image/class_ImageTemplateEngine.php b/framework/main/classes/template/image/class_ImageTemplateEngine.php index 3dbdb96d..ba6b3c6b 100644 --- a/framework/main/classes/template/image/class_ImageTemplateEngine.php +++ b/framework/main/classes/template/image/class_ImageTemplateEngine.php @@ -84,7 +84,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl * * @return $templateInstance An instance of TemplateEngine * @throws UnexpectedValueException If the provided $templateBasePath is empty or no string - * @throws BasePathIsNoDirectoryException If $templateBasePath is no + * @throws InvalidDirectoryException If $templateBasePath is no * directory or not found * @throws BasePathReadProtectedException If $templateBasePath is * read-protected @@ -108,7 +108,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl throw new UnexpectedValueException(sprintf('[%s:%d] %s is not a string with a base path.', $templateInstance->__toString(), __LINE__, $templateBasePath), self::EXCEPTION_INVALID_STRING); } elseif (!is_dir($templateBasePath)) { // Is not a path - throw new BasePathIsNoDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME); + throw new InvalidDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME); } elseif (!is_readable($templateBasePath)) { // Is not readable throw new BasePathReadProtectedException(array($templateInstance, $templateBasePath), self::EXCEPTION_READ_PROTECED_PATH); diff --git a/framework/main/classes/template/mail/class_MailTemplateEngine.php b/framework/main/classes/template/mail/class_MailTemplateEngine.php index 04e59829..109880f2 100644 --- a/framework/main/classes/template/mail/class_MailTemplateEngine.php +++ b/framework/main/classes/template/mail/class_MailTemplateEngine.php @@ -78,7 +78,7 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla * * @return $templateInstance An instance of TemplateEngine * @throws UnexpectedValueException If the provided $templateBasePath is empty or no string - * @throws BasePathIsNoDirectoryException If $templateBasePath is no + * @throws InvalidDirectoryException If $templateBasePath is no * directory or not found * @throws BasePathReadProtectedException If $templateBasePath is * read-protected @@ -102,7 +102,7 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla throw new UnexpectedValueException(sprintf('[%s:%d] %s is not a string with a base path.', $templateInstance->__toString(), __LINE__, $templateBasePath), self::EXCEPTION_INVALID_STRING); } elseif (!is_dir($templateBasePath)) { // Is not a path - throw new BasePathIsNoDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME); + throw new InvalidDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME); } elseif (!is_readable($templateBasePath)) { // Is not readable throw new BasePathReadProtectedException(array($templateInstance, $templateBasePath), self::EXCEPTION_READ_PROTECED_PATH); diff --git a/framework/main/classes/template/menu/class_MenuTemplateEngine.php b/framework/main/classes/template/menu/class_MenuTemplateEngine.php index e21e97df..c5601b4c 100644 --- a/framework/main/classes/template/menu/class_MenuTemplateEngine.php +++ b/framework/main/classes/template/menu/class_MenuTemplateEngine.php @@ -4,6 +4,7 @@ namespace CoreFramework\Template\Engine; // Import framework stuff use CoreFramework\Factory\ObjectFactory; +use CoreFramework\Filesystem\InvalidDirectoryException; use CoreFramework\Parser\Xml\XmlParser; use CoreFramework\Registry\Registry; use CoreFramework\Template\CompileableTemplate; @@ -138,8 +139,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla * @param $menuInstance A RenderableMenu instance * @return $templateInstance An instance of TemplateEngine * @throws UnexpectedValueException If the found $templateBasePath is empty or not a string - * @throws BasePathIsNoDirectoryException If $templateBasePath is no - * directory or not found + * @throws InvalidDirectoryException If $templateBasePath is no directory or not found * @throws BasePathReadProtectedException If $templateBasePath is * read-protected */ @@ -162,7 +162,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla throw new UnexpectedValueException(sprintf('[%s:%d] %s is not a string with a base path.', $templateInstance->__toString(), __LINE__, $templateBasePath), self::EXCEPTION_INVALID_STRING); } elseif (!is_dir($templateBasePath)) { // Is not a path - throw new BasePathIsNoDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME); + throw new InvalidDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME); } elseif (!is_readable($templateBasePath)) { // Is not readable throw new BasePathReadProtectedException(array($templateInstance, $templateBasePath), self::EXCEPTION_READ_PROTECED_PATH); diff --git a/framework/main/exceptions/template/class_BasePathIsNoDirectoryException.php b/framework/main/exceptions/template/class_InvalidDirectoryException.php similarity index 87% rename from framework/main/exceptions/template/class_BasePathIsNoDirectoryException.php rename to framework/main/exceptions/template/class_InvalidDirectoryException.php index eeb095f3..d40774da 100644 --- a/framework/main/exceptions/template/class_BasePathIsNoDirectoryException.php +++ b/framework/main/exceptions/template/class_InvalidDirectoryException.php @@ -1,6 +1,6 @@ . */ -class BasePathIsNoDirectoryException extends FrameworkException { +class InvalidDirectoryException extends FrameworkException { /** * The constructor * @@ -38,7 +37,7 @@ class BasePathIsNoDirectoryException extends FrameworkException { */ public function __construct (array $classArray, $code) { // Add a message around the missing class - $message = sprintf('[%s:%d] Template base path "%s" does not exist.', + $message = sprintf('[%s:%d] Path "%s" is no directory.', $classArray[0]->__toString(), $this->getLine(), $classArray[1] -- 2.30.2