]> git.mxchange.org Git - core.git/commitdiff
renamed deprecated exception name to a more common one
authorRoland Haeder <roland@mxchange.org>
Sat, 4 Mar 2017 22:15:22 +0000 (23:15 +0100)
committerRoland Haeder <roland@mxchange.org>
Sat, 4 Mar 2017 22:15:22 +0000 (23:15 +0100)
Signed-off-by: Roland Häder <roland@mxchange.org>
framework/main/classes/template/console/class_ConsoleTemplateEngine.php
framework/main/classes/template/html/class_HtmlTemplateEngine.php
framework/main/classes/template/image/class_ImageTemplateEngine.php
framework/main/classes/template/mail/class_MailTemplateEngine.php
framework/main/classes/template/menu/class_MenuTemplateEngine.php
framework/main/exceptions/template/class_BasePathIsNoDirectoryException.php [deleted file]
framework/main/exceptions/template/class_InvalidDirectoryException.php [new file with mode: 0644]

index e4ca45eb4deb7e223667a7daf2ac42fa58fb93ab..9d485c4e9b191ef347e6af95b0d4ab068651286a 100644 (file)
@@ -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);
index 9fd2f2853336348666be834b19eb69528a4b8aea..0ecfa8625083f632e36bef21dabcf57364b7f7c2 100644 (file)
@@ -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);
index 3dbdb96d89426d926ff0fa6a6f5be67aab909f87..ba6b3c6b2206674185fca3be4d8199e81501ce1b 100644 (file)
@@ -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);
index 04e59829dc55300ba8796b0d0f1d6e951ac9823c..109880f2d4981a00faca1924e79332c3860c5021 100644 (file)
@@ -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);
index e21e97dff11df9850646eb030dda673e0b0fd5e7..c5601b4c647d46b1ac6c5f17ccdcb2cb3bb9d51d 100644 (file)
@@ -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_BasePathIsNoDirectoryException.php
deleted file mode 100644 (file)
index eeb095f..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-// Own namespace
-namespace CoreFramework\Deprecated;
-
-// Import framework stuff
-use CoreFramework\Generic\FrameworkException;
-
-/**
- * An exception thrown when the base path is no directory
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- * @deprecated Don't use this anymore
- * 
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class BasePathIsNoDirectoryException extends FrameworkException {
-       /**
-        * The constructor
-        *
-        * @param       $classArray             An array holding our informations
-        * @param       $code                   Code number for the exception
-        * @return      void
-        */
-       public function __construct (array $classArray, $code) {
-               // Add a message around the missing class
-               $message = sprintf('[%s:%d] Template base path "%s" does not exist.',
-                       $classArray[0]->__toString(),
-                       $this->getLine(),
-                       $classArray[1]
-               );
-
-               // Call parent constructor
-               parent::__construct($message, $code);
-       }
-
-}
diff --git a/framework/main/exceptions/template/class_InvalidDirectoryException.php b/framework/main/exceptions/template/class_InvalidDirectoryException.php
new file mode 100644 (file)
index 0000000..d40774d
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+// Own namespace
+namespace CoreFramework\Filesystem;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
+/**
+ * An exception thrown when the base path is no directory
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class InvalidDirectoryException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $classArray             An array holding our informations
+        * @param       $code                   Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $classArray, $code) {
+               // Add a message around the missing class
+               $message = sprintf('[%s:%d] Path "%s" is no directory.',
+                       $classArray[0]->__toString(),
+                       $this->getLine(),
+                       $classArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+
+}