Finished first cleanup (still a lot is broken):
authorRoland Haeder <roland@mxchange.org>
Tue, 21 Feb 2017 20:39:36 +0000 (21:39 +0100)
committerRoland Haeder <roland@mxchange.org>
Tue, 28 Feb 2017 21:10:04 +0000 (22:10 +0100)
- added more namespaces
- made more exceptions deprecated as there are better exceptions or names for it
- removed own [EOF] (old coding style)
- removed discouraged ?> from all files

Signed-off-by: Roland Häder <roland@mxchange.org>
28 files changed:
inc/main/exceptions/database/class_DatabaseException.php
inc/main/exceptions/file_directory/class_FileIoException.php
inc/main/exceptions/file_directory/class_FileNotFoundException.php
inc/main/exceptions/file_directory/class_FileReadProtectedException.php
inc/main/exceptions/file_directory/class_InvalidMD5ChecksumException.php
inc/main/exceptions/file_directory/class_PathIsNoDirectoryException.php
inc/main/exceptions/file_directory/class_PathReadProtectedException.php
inc/main/exceptions/file_directory/class_PathWriteProtectedException.php
inc/main/exceptions/main/class_AssertionException.php
inc/main/exceptions/main/class_ClassMismatchException.php
inc/main/exceptions/main/class_EmptyVariableException.php
inc/main/exceptions/main/class_FatalErrorException.php
inc/main/exceptions/main/class_IndexOutOfBoundsException.php
inc/main/exceptions/main/class_InvalidArrayCountException.php
inc/main/exceptions/main/class_InvalidCommandException.php
inc/main/exceptions/main/class_InvalidCommandInstanceException.php
inc/main/exceptions/main/class_InvalidInterfaceException.php
inc/main/exceptions/main/class_MissingArrayElementsException.php
inc/main/exceptions/main/class_MissingDecimalsThousandsSeparatorException.php
inc/main/exceptions/main/class_MissingMethodException.php
inc/main/exceptions/main/class_NoClassException.php
inc/main/exceptions/main/class_VariableIsNotSetException.php
inc/main/exceptions/user/class_AccountPasswordMismatchException.php
inc/main/exceptions/user/class_UnexpectedGuestAccountException.php
inc/main/exceptions/user/class_UserEmailMissingException.php
inc/main/exceptions/user/class_UserNoGuestException.php
inc/main/exceptions/user/class_UserPasswordMismatchException.php
inc/main/exceptions/user/class_UsernameMissingException.php

index b46532b597ae7681d01e1f23cd84c7cd4ad09c45..b5d37accd531a2b25e2dbab3ffa1cfbf1257e840 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Database;
+
 /**
  * A general database exception
  *
@@ -33,7 +36,5 @@ class DatabaseException extends FrameworkException {
                // Just call the parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 5843c40febdaaeb29c47d87bd3f48944bf90da85..e769092c3ff7932022eaaf13e88fe1a89a59fd6f 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Filesystem;
+
 /**
  * An exception thrown when a file pointer is not opened or when the file
  * cannot be reached.
@@ -37,7 +40,5 @@ class FileIoException extends FrameworkException {
                // Call parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 4641ce1ece75bdd6252d8f9ba4a0e5040a90a839..2e13bdcf4b57e75855458ca410b43816f6666f53 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Filesystem;
+
 /**
  * An exception thrown when a file was not found (but could be found).
  *
@@ -36,7 +39,5 @@ class FileNotFoundException extends FrameworkException {
                // Call parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 641e420c2e880ce3c00b5203723be53782ff3e75..fdd13ecf17dc336cbeec9ee240aec6013e9fce2a 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Deprecated;
+
 /**
  * An exception thrown when a file is read-protected
  *
@@ -7,6 +10,7 @@
  * @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 read 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
@@ -36,7 +40,5 @@ class FileReadProtectedException extends FrameworkException {
                // Call parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 174d97462ff2d701b58a713a2273e385758beb71..ce688d174b399ad586299074fb76c7121d06c879 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Deprecated;
+
 /**
  * An exception thrown when a MD5 checksum does not exception
  *
@@ -7,6 +10,7 @@
  * @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
@@ -41,7 +45,5 @@ class InvalidMD5ChecksumException extends FrameworkException {
                // Call parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 13322dd381253682b4a533d0d1205db6c12bcf5e..4a33ea8a13627947fa5eb80801b1380b94cf9d1a 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Deprecated;
+
 /**
  * An exception thrown when a given path is not a directory
  *
@@ -7,6 +10,7 @@
  * @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
@@ -36,7 +40,5 @@ class PathIsNoDirectoryException extends FrameworkException {
                // Call parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 399a25efc7c89fe5a7678c1b442fee351aaafa02..c64568bfa2bf3cba2b42e2efc74ee2e685fc9fb1 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Deprecated;
+
 /**
  * An exception thrown when a path is read-protected
  *
@@ -7,6 +10,7 @@
  * @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
@@ -36,7 +40,5 @@ class PathReadProtectedException extends FrameworkException {
                // Call parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 3fa5b9d749699bd54daa1799d310eae49eef6255..9dec65d255e4efa0885c72c4654ecad37b3bc844 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Deprecated;
+
 /**
  * An exception thrown when a path cannot be written to.
  *
@@ -7,6 +10,7 @@
  * @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
@@ -36,7 +40,5 @@ class FileWriteProtectedException extends FrameworkException {
                // Call parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index f2e19fe313b7b3b2d491d289bdd2822ceb8cfd59..3217e530f1590c69dd3def40ee66fe6226e8e5c4 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Assertion;
+
 /**
  * An exception thrown when a assertion fails
  *
@@ -33,7 +36,5 @@ class AssertionException extends FrameworkException {
                // Call parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index a81a3807412f8c339d0d3dce873b131fba12371c..5c3052aacaac4b4c4c76ce51826081b16406745c 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Object;
+
 /**
  * An exception thrown when two classes are not matching
  *
@@ -39,7 +42,5 @@ class ClassMismatchException extends FrameworkException {
                // Call parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 9928af9bd37742ca632ccffd5d50f96fc2bfddea..b6ecad00ff6ce87d265c695896163d8acf785af2 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Deprecated;
+
 /**
  * This exception is thrown when a variable is unexpected empty
  *
@@ -7,6 +10,7 @@
  * @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
@@ -40,7 +44,5 @@ class EmptyVariableException extends FrameworkException {
                // Call parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 088b870396327795d33c87b9d224f7412595b31c..43b72b38962cd977143548d36cf5addea9c3e9b3 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Error;
+
 /**
  * An exception thrown when a "fatal" error has been captured by an error handler
  *
@@ -33,7 +36,5 @@ class FatalErrorException extends FrameworkException {
                // Call parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 53d77ad33ce649b396d550f383edc1b94e8a1428..45d7a3e8df48d54ec5cceea3d7b896ef7ca6b0a7 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Array;
+
 /**
  * An exception thrown when an array index is out of bounds
  *
@@ -38,7 +41,5 @@ class IndexOutOfBoundsException extends FrameworkException {
                // Call parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 0bf606a8a1cfcba8214f981675af3094b462c52e..3aab2aee8a7b0f034d32744a73677d15eb950f74 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Deprecated;
+
 /**
  * An exception thrown when the number of array elements mismatch
  *
@@ -7,6 +10,7 @@
  * @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
@@ -42,7 +46,5 @@ class InvalidArrayCountException extends FrameworkException {
                // Call parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 8ba24107e108dc274ab9ed70fbaa3fcbf0ade48b..9c1476f2f61105a5ada4109bd1492f7892a5b106 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Deprecated;
+
 /**
  * This exception is thrown when a command is invalid
  *
@@ -7,6 +10,7 @@
  * @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
@@ -44,7 +48,5 @@ class InvalidCommandException extends FrameworkException {
                // Call parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 5786206d64a307fcfdcb127582d872ecc0440ba3..f4d171b19d8c2ac6f0a85f2034a340497f06a5f7 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Deprecated;
+
 /**
  * This exception is thrown when a command instance is invalid
  *
@@ -7,6 +10,7 @@
  * @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
@@ -40,7 +44,5 @@ class InvalidCommandInstanceException extends FrameworkException {
                // Call parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 822afad6428587297aac06535615259cc891d65e..1458a3cb453aedd0833afd2f72bbfd667b39470c 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Object;
+
 /**
  * An exception thrown when an class instance does not implement a given interface
  *
@@ -40,7 +43,5 @@ class InvalidInterfaceException extends FrameworkException {
                // Call parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 3e67a674e2d7560c4ab64871003d653f46d613d9..6d8435341917ce14b860eee82a6363d83a1d797e 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Array;
+
 /**
  * An exception thrown when required array elements are missing
  *
@@ -51,7 +54,5 @@ class MissingArrayElementsException extends FrameworkException {
                // Call parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 5e1c9ff049903cef9b6ae0037ea6633a85931bfd..5ee19edfe2dfc5688f74c838daa0ff558351246b 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Deprecated;
+
 /**
  * An exception thrown when the decimal and thousands separators are missing
  *
@@ -7,6 +10,7 @@
  * @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
@@ -39,7 +43,5 @@ class MissingDecimalsThousandsSeparatorException extends FrameworkException {
                // Call parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index cebe42a905555e8e88dea9580588c00c2d1f0cff..b033837c9d0d854d58228e02197055f11fee1ff4 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Object;
+
 /**
  * An exception thrown when a method is missing, this exception is used in
  * guest/user login classes and thrown when a factory method is absend. I think
@@ -36,7 +39,7 @@ class MissingMethodException extends FrameworkException {
         */
        public function __construct (array $classArray, $code) {
                // Add a message around the missing class
-               $message = sprintf('[%s:%d] This class has no method <u>%s()</u>.',
+               $message = sprintf('[%s:%d] This class has no method %s().',
                        $classArray[0]->__toString(),
                        $this->getLine(),
                        $classArray[1]
@@ -45,7 +48,5 @@ class MissingMethodException extends FrameworkException {
                // Call parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 1d666c4d14e1eebff7558521b9a6bada8fe8e45c..eb5341c4d5b0a0de251956a74ff6ee7cb65ac910 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Loader;
+
 /**
  * An exception thrown when a class was not found
  *
@@ -43,7 +46,5 @@ class NoClassException extends FrameworkException {
                // Call parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 680be29d7a6f5195b3d00fbaeac03996c78d929e..7e6efb04e0b35ac80f519755f5df802906f0abb5 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Deprecated;
+
 /**
  * An exception thrown when a variable is not set
  *
@@ -7,6 +10,7 @@
  * @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
@@ -41,7 +45,5 @@ class VariableIsNotSetException extends FrameworkException {
                // Call parent constructor
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 3bfa5b2c07df54a03fd7e677f964b921b3224123..1b1862428ed4a67a0f4ae16e4cf983e051376794 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\User;
+
 /**
  * An exception for mismatching passwords
  *
@@ -39,7 +42,5 @@ class AccountPasswordMismatchException extends FrameworkException {
                // Make sure everything is assigned properly
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index c7eb157cda020a32157a22960378046515e6bada..9ad167b065ecc6786fa2b2f40304ed19ecd07291 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\User;
+
 /**
  * An exception for unexpected guest accounts
  *
@@ -40,7 +43,5 @@ class UnexpectedGuestAccountException extends FrameworkException {
                // Make sure everything is assigned properly
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 7eee4b135ad01b76e3fd4d852c972153c9c41725..df122190a1963bf95492ef65bc00618dca916127 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\User;
+
 /**
  * An exception for non-existing user emails
  *
@@ -40,7 +43,5 @@ class UserEmailMissingException extends FrameworkException {
                // Make sure everything is assigned properly
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index f1703232537f320ce0581c69813f2080604f46d3..22d623a79f06c686283a946eda4835daebd80d5f 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Deprecated;
+
 /**
  * An exception for non-guest accounts (but guest was expected)
  *
@@ -7,6 +10,7 @@
  * @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
+ * @todo               Better rename this
  *
  * 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
@@ -41,7 +45,5 @@ class UserNoGuestException extends FrameworkException {
                // Make sure everything is assigned properly
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 366dd10d96242fd63c64c03f55df51840270d972..a209ce40cc0c6f05015714f47e7fd85031afe99d 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\User;
+
 /**
  * An exception for mismatching passwords
  *
@@ -40,7 +43,5 @@ class UserPasswordMismatchException extends FrameworkException {
                // Make sure everything is assigned properly
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}
index 2e321ec2537c628db66a47b2835f076e9e29f3cb..0f45d3c3492d4767d59d0ea9cf7dd1a3c7e81836 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\User;
+
 /**
  * An exception for non-existing usernames
  *
@@ -40,7 +43,5 @@ class UsernameMissingException extends FrameworkException {
                // Make sure everything is assigned properly
                parent::__construct($message, $code);
        }
-}
 
-// [EOF]
-?>
+}