]> git.mxchange.org Git - core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Wed, 2 Dec 2020 01:06:29 +0000 (02:06 +0100)
committerRoland Häder <roland@mxchange.org>
Wed, 2 Dec 2020 01:06:29 +0000 (02:06 +0100)
- got rid of 3 deprecated exceptions

Signed-off-by: Roland Häder <roland@mxchange.org>
framework/main/classes/language/class_LanguageSystem.php
framework/main/exceptions/language/class_InvalidLanguagePathStringException.php [deleted file]
framework/main/exceptions/language/class_LanguagePathIsNoDirectoryException.php [deleted file]
framework/main/exceptions/language/class_LanguagePathReadProtectedException.php [deleted file]

index 3080899bd2a0a39598dc7d6acbf08c03f44e7fc5..ebcfc38e6e1a0cae8bd7fc90c10f4800294ef053 100644 (file)
@@ -73,10 +73,10 @@ class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage,
         * @param       $languageBasePath       The local base path for all language strings or emty for auto-detection
         * @return      $langInstance   An instance of LanguageSystem
         * @throws      InvalidArgumentException        If languageBasePath remains empty (@TODO Get rid of that old-lost code)
-        * @throws      InvalidLanguagePathStringException      If $languageBasePath is no string
-        * @throws      LanguagePathIsNoDirectoryException      If $languageBasePath is no
+        * @throws      InvalidArgumentException        If $languageBasePath is no string
+        * @throws      InvalidArgumentException        If $languageBasePath is no
         *                                                                              directory or not found
-        * @throws      LanguagePathReadProtectedException      If $languageBasePath is
+        * @throws      InvalidArgumentException        If $languageBasePath is
         *                                                                              read-protected
         */
        public static final function createLanguageSystem (string $languageBasePath = '') {
@@ -102,13 +102,13 @@ class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage,
                        throw new InvalidArgumentException('languageBasePath is still empty');
                } elseif (!is_string($languageBasePath)) {
                        // Is not a string
-                       throw new InvalidLanguagePathStringException(array($langInstance, $languageBasePath), self::EXCEPTION_INVALID_STRING);
+                       throw new InvalidArgumentException(array($langInstance, $languageBasePath), self::EXCEPTION_INVALID_STRING);
                } elseif (!is_dir($languageBasePath)) {
                        // Is not a path
-                       throw new LanguagePathIsNoDirectoryException(array($langInstance, $languageBasePath), self::EXCEPTION_INVALID_PATH_NAME);
+                       throw new InvalidArgumentException(array($langInstance, $languageBasePath), self::EXCEPTION_INVALID_PATH_NAME);
                } elseif (!is_readable($languageBasePath)) {
                        // Is not readable
-                       throw new LanguagePathReadProtectedException(array($langInstance, $languageBasePath), self::EXCEPTION_READ_PROTECED_PATH);
+                       throw new InvalidArgumentException(array($langInstance, $languageBasePath), self::EXCEPTION_READ_PROTECED_PATH);
                }
 
                // Set the base path
diff --git a/framework/main/exceptions/language/class_InvalidLanguagePathStringException.php b/framework/main/exceptions/language/class_InvalidLanguagePathStringException.php
deleted file mode 100644 (file)
index fc49eeb..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Mxchange\CoreFramework\Deprecated;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Generic\FrameworkException;
-
-/**
- * An exception thrown when the language path string is invalid
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 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 InvalidLanguagePathStringException extends FrameworkException {
-       /**
-        * The constructor
-        *
-        * @param       $classArray             Array holding exception data
-        * @param       $code                   Code number for the exception
-        * @return      void
-        */
-       public function __construct (array $classArray, int $code) {
-               // Add a message around the missing class
-               $message = sprintf('[%s:%d] %s is not a string with path.',
-                       $classArray[0]->__toString(),
-                       $this->getLine(),
-                       $classArray[1]
-               );
-
-               // Call parent constructor
-               parent::__construct($message, $code);
-       }
-
-}
diff --git a/framework/main/exceptions/language/class_LanguagePathIsNoDirectoryException.php b/framework/main/exceptions/language/class_LanguagePathIsNoDirectoryException.php
deleted file mode 100644 (file)
index 60c6565..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Mxchange\CoreFramework\Deprecated;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Generic\FrameworkException;
-
-/**
- * An exception thrown when the language path is no directory
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- * @todo               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 LanguagePathIsNoDirectoryException extends FrameworkException {
-       /**
-        * The constructor
-        *
-        * @param       $classArray             Array holding exception data
-        * @param       $code                   Code number for the exception
-        * @return      void
-        */
-       public function __construct (array $classArray, int $code) {
-               // Add a message around the missing class
-               $message = sprintf('[%s:%d] Language base path %s does not exist or is not a directory.',
-                       $classArray[0]->__toString(),
-                       $this->getLine(),
-                       $classArray[1]
-               );
-
-               // Call parent constructor
-               parent::__construct($message, $code);
-       }
-
-}
diff --git a/framework/main/exceptions/language/class_LanguagePathReadProtectedException.php b/framework/main/exceptions/language/class_LanguagePathReadProtectedException.php
deleted file mode 100644 (file)
index 9b74043..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-// Own namespace
-namespace Org\Mxchange\CoreFramework\Deprecated;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Generic\FrameworkException;
-
-/**
- * An exception thrown when the language path is read-protected
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 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 LanguagePathReadProtectedException extends FrameworkException {
-       /**
-        * The constructor
-        *
-        * @param       $class  Array holding exception data
-        * @param       $code   Code number for the exception
-        * @return      void
-        */
-       public function __construct (array $classArray, int $code) {
-               // Add a message around the missing class
-               $message = sprintf('[%s:%d] Base language path %s is read-protected. Please change access rights (CHMOD).',
-                       $classArray[0]->__toString(),
-                       $this->getLine(),
-                       $classArray[1]
-               );
-
-               // Call parent constructor
-               parent::__construct($message, $code);
-       }
-
-}