From 67f34799fe805b8a01cd56f64d12813a37195ee1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 13 Aug 2017 21:19:54 +0200 Subject: [PATCH] Rewrite continues: - EmptyVariableException can be easily replaced by InvalidArgumentException (IEA) because there is no need for to over-detailed exceptions, but still it is a good idea to have more (custom) around than the defaults - MissingMethodException was no longer used and is now emptied - updated TODOs.txt - ignored vendor in todo-builder.sh MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- contrib/todo-builder.sh | 4 +- docs/TODOs.txt | 145 +++++++++--------- .../factories/objects/class_ObjectFactory.php | 6 +- .../html/forms/class_HtmlFormHelper.php | 22 ++- .../action/class_BaseActionResolver.php | 12 +- .../action/html/class_HtmlActionResolver.php | 8 +- .../command/class_BaseCommandResolver.php | 8 +- .../console/class_ConsoleCommandResolver.php | 8 +- .../html/class_HtmlCommandResolver.php | 8 +- .../image/class_ImageCommandResolver.php | 8 +- .../class_BaseControllerResolver.php | 12 +- .../class_ConsoleControllerResolver.php | 13 +- .../html/class_HtmlControllerResolver.php | 15 +- .../image/class_ImageControllerResolver.php | 15 +- .../template/class_BaseTemplateEngine.php | 6 +- .../main/class_EmptyVariableException.php | 50 +----- .../main/class_MissingMethodException.php | 55 +------ .../resolver/actions/class_ActionResolver.php | 2 +- .../class_TestsConsoleCommandResolver.php | 8 +- .../class_TestsConsoleControllerResolver.php | 8 +- 20 files changed, 170 insertions(+), 243 deletions(-) diff --git a/contrib/todo-builder.sh b/contrib/todo-builder.sh index 295b6ba0..0a5ae001 100755 --- a/contrib/todo-builder.sh +++ b/contrib/todo-builder.sh @@ -11,8 +11,8 @@ fi echo "$0: Generating TODOs.txt..." echo "### WARNING: THIS FILE IS AUTO-GENERATED BY $0 ###" > docs/TODOs.txt echo "### DO NOT EDIT THIS FILE. ###" >> docs/TODOs.txt -find -type f -name "*.php" -exec grep -Hin "@TODO" {} \; | sort >> docs/TODOs.txt +find -type f -name "*.php" -exec grep -Hin "@TODO" {} \; | grep -v "/vendor/" | sort >> docs/TODOs.txt echo "### ### DEPRECATION FOLLOWS: ### ###" >> docs/TODOs.txt -find -type f -name "*.php" -exec grep -Hin "@DEPRECATED" {} \; | sort >> docs/TODOs.txt +find -type f -name "*.php" -exec grep -Hin "@DEPRECATED" {} \; | grep -v "/vendor/" | sort >> docs/TODOs.txt echo "$0: Done." exit 0 diff --git a/docs/TODOs.txt b/docs/TODOs.txt index a0f39efc..8ffdd748 100644 --- a/docs/TODOs.txt +++ b/docs/TODOs.txt @@ -1,24 +1,26 @@ ### WARNING: THIS FILE IS AUTO-GENERATED BY ./contrib/todo-builder.sh ### ### DO NOT EDIT THIS FILE. ### -./application/tests/class_ApplicationHelper.php:273: * @todo Nothing to add? -./framework/config/class_FrameworkConfiguration.php:127: * @todo This method encapsulates a deprecated PHP function and should be deprecated, too. -./framework/config/class_FrameworkConfiguration.php:252: * @todo Have to check some more entries from $_SERVER here -./framework/loader/class_ClassLoader.php:232: // @TODO Throw exception instead of break -./framework/loader/class_ClassLoader.php:423: /* @TODO: Do not exit here. */ +./application/tests/class_ApplicationHelper.php:272: * @todo Nothing to add? +./contrib/audio.php:96: // @TODO What do here to remove noise? +./framework/bootstrap/class_FrameworkBootstrap.php:421: * @todo Have to check some more entries from $_SERVER here +./framework/bootstrap/class_FrameworkBootstrap.php:493: * @todo Test more fields +./framework/loader/class_ClassLoader.php:181: // @TODO Add some uglifying code (compress) here +./framework/loader/class_ClassLoader.php:247: // @TODO Throw exception instead of break +./framework/loader/class_ClassLoader.php:441: /* @TODO: Do not exit here. */ ./framework/main/classes/cache/class_MemoryCache.php:17: * @todo Rename to InProgressCache -./framework/main/classes/class_BaseFrameworkSystem.php:2116: // @TODO Move the constant to e.g. BaseDatabaseResult when there is a non-cached database result available -./framework/main/classes/class_BaseFrameworkSystem.php:2231: * @todo Write a logging mechanism for productive mode -./framework/main/classes/class_BaseFrameworkSystem.php:2246: // @TODO Finish this part! -./framework/main/classes/class_BaseFrameworkSystem.php:3232: * @todo Improve documentation -./framework/main/classes/class_BaseFrameworkSystem.php:343: // @todo Try to clean these constants up +./framework/main/classes/class_BaseFrameworkSystem.php:2133: // @TODO Move the constant to e.g. BaseDatabaseResult when there is a non-cached database result available +./framework/main/classes/class_BaseFrameworkSystem.php:2248: * @todo Write a logging mechanism for productive mode +./framework/main/classes/class_BaseFrameworkSystem.php:2263: // @TODO Finish this part! +./framework/main/classes/class_BaseFrameworkSystem.php:3249: * @todo Improve documentation +./framework/main/classes/class_BaseFrameworkSystem.php:344: // @todo Try to clean these constants up ./framework/main/classes/class_BaseFrameworkSystem.php:589: // @TODO __CLASS__ does always return BaseFrameworkSystem but not the extending (=child) class ./framework/main/classes/class_BaseFrameworkSystem.php:693: * @todo SearchableResult and UpdateableResult shall have a super interface to use here -./framework/main/classes/commands/console/class_ConsoleFuseCommand.php:83: // @TODO Unfinished +./framework/main/classes/commands/console/class_ConsoleFuseCommand.php:84: // @TODO Unfinished ./framework/main/classes/commands/html/class_HtmlLoginAreaCommand.php:78: * @todo Add some stuff here: Some personal data, app/game related data ./framework/main/classes/commands/html/class_HtmlProblemCommand.php:70: * @todo 0% done ./framework/main/classes/commands/html/class_HtmlStatusCommand.php:70: * @todo 0% done ./framework/main/classes/controller/console/class_ConsoleDefaultController.php:19: * @todo This controller shall still provide some headlines for sidebars -./framework/main/classes/controller/html/class_HtmlConfirmController.php:50: * @todo Add some filters to this controller +./framework/main/classes/controller/html/class_HtmlConfirmController.php:51: * @todo Add some filters to this controller ./framework/main/classes/controller/html/class_HtmlDefaultController.php:20: * @todo This controller shall still provide some headlines for sidebars ./framework/main/classes/controller/html/class_HtmlLoginController.php:51: * @todo Add some filters to this controller ./framework/main/classes/controller/html/class_HtmlLogoutController.php:21: * @todo This controller shall still provide some headlines for sidebars @@ -27,29 +29,29 @@ ./framework/main/classes/controller/html/class_HtmlRegisterController.php:50: * @todo Add some filters to this controller ./framework/main/classes/controller/html/class_HtmlStatusController.php:20: * @todo This controller shall still provide some headlines for sidebars ./framework/main/classes/controller/html/login/class_HtmlLoginAreaController.php:51: * @todo Add some morer filters to this controller -./framework/main/classes/criteria/dataset/class_DataSetCriteria.php:157: // @TODO Issue a warning +./framework/main/classes/criteria/dataset/class_DataSetCriteria.php:158: // @TODO Issue a warning ./framework/main/classes/criteria/search/class_SearchCriteria.php:109: * @todo Find a nice casting here. (int) allows until and including 32766. ./framework/main/classes/criteria/search/class_SearchCriteria.php:77: * @todo Find a nice casting here. (int) allows until and including 32766. ./framework/main/classes/crypto/class_CryptoHelper.php:104: // @TODO Maybe rewrite this with DirectoryIterator, similar to Compressor thing? -./framework/main/classes/database/backend/class_CachedLocalFileDatabase.php:339: * @todo Do some checks on the database directory and files here -./framework/main/classes/database/backend/class_CachedLocalFileDatabase.php:628: * @todo Add more generic non-public data for removal +./framework/main/classes/database/backend/lfdb_legacy/class_CachedLocalFileDatabase.php:340: * @todo Do some checks on the database directory and files here +./framework/main/classes/database/backend/lfdb_legacy/class_CachedLocalFileDatabase.php:629: * @todo Add more generic non-public data for removal ./framework/main/classes/database/class_BaseDatabaseWrapper.php:214: // @TODO Minor: Update above comment to e.g. BaseDatabaseResult ./framework/main/classes/database/frontend/class_NewsDatabaseWrapper.php:17: * @todo Add missing own interface for public methods -./framework/main/classes/database/frontend/class_PaymentsDatabaseWrapper.php:16: * @todo Add missing own interface for public methods +./framework/main/classes/database/frontend/class_PaymentsDatabaseWrapper.php:17: * @todo Add missing own interface for public methods ./framework/main/classes/database/result/class_CachedDatabaseResult.php:260: * @todo 0% done ./framework/main/classes/database/result/class_CachedDatabaseResult.php:414: * @todo Find a caching way without modifying the result array ./framework/main/classes/decorator/template/class_XmlRewriterTemplateDecorator.php:415: * @todo Find something useful with this! -./framework/main/classes/discovery/payment/class_LocalPaymentDiscovery.php:96: * @todo 0% done +./framework/main/classes/discovery/payment/class_LocalPaymentDiscovery.php:98: * @todo 0% done ./framework/main/classes/factories/logger/class_LoggerFactory.php:53: // @TODO Unfinished work ./framework/main/classes/factories/login/class_LoginFactory.php:47: * @return $loginInstance An instance of a login helper (@TODO Use actual interface name) ./framework/main/classes/factories/user/class_UserFactory.php:48: * @return $userInstance An instance of a user class (@TODO use actual interface name) ./framework/main/classes/feature/fuse/class_FuseFeature.php:59: * @todo 0% done -./framework/main/classes/file_directories/binary/class_BaseBinaryFile.php:856: // @TODO Unfinished -./framework/main/classes/file_directories/class_BaseAbstractFile.php:163: * @todo Handle seekStatus -./framework/main/classes/file_directories/class_BaseFileIo.php:180: * @todo Handle seekStatus -./framework/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php:78: * @todo Get rid of inConstructor, could be old-lost code. -./framework/main/classes/file_directories/io_stream/class_FileIoStream.php:274: * @todo 0% done -./framework/main/classes/file_directories/io_stream/class_FileIoStream.php:84: * @todo This method needs heavy rewrite +./framework/main/classes/file_directories/binary/class_BaseBinaryFile.php:860: // @TODO Unfinished +./framework/main/classes/file_directories/class_BaseAbstractFile.php:135: * @todo Handle seekStatus +./framework/main/classes/file_directories/class_BaseFileIo.php:166: * @todo Handle seekStatus +./framework/main/classes/file_directories/io/class_FrameworkFileInputOutputPointer.php:106: * @todo Add more checks +./framework/main/classes/file_directories/io_stream/class_FileIoStream.php:279: * @todo 0% done +./framework/main/classes/file_directories/io_stream/class_FileIoStream.php:89: * @todo This method needs heavy rewrite ./framework/main/classes/filter/change/class_EmailChangeFilter.php:65: * @todo Implement email change of the user here. HINT: Use the User class! ./framework/main/classes/filter/change/class_PasswordChangeFilter.php:65: * @todo Finished updating user password hash here. HINT: Use the User class again. ./framework/main/classes/filter/news/class_NewsProcessFilter.php:64: * @todo Unfinished stub, add functionality here @@ -62,11 +64,11 @@ ./framework/main/classes/helper/class_BaseHelper.php:193: * @todo Rewrite this method using a helper class for filtering data ./framework/main/classes/helper/class_BaseHelper.php:222: // @TODO Try to log it here ./framework/main/classes/helper/class_BaseHelper.php:488: $this->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] fieldName=' . $fieldName . ' is not set! - @TODO'); -./framework/main/classes/helper/html/forms/class_HtmlFormHelper.php:114: * @todo Add some unique PIN here to bypass problems with some browser and/or extensions -./framework/main/classes/helper/html/forms/class_HtmlFormHelper.php:633: * @todo Add checking if sub option is already added -./framework/main/classes/helper/html/forms/class_HtmlFormHelper.php:661: * @todo Add checking if sub option is already added -./framework/main/classes/helper/html/forms/class_HtmlFormHelper.php:695: // @TODO We need to log this later -./framework/main/classes/helper/html/forms/class_HtmlFormHelper.php:864: * @todo Implement check if rules have been changed +./framework/main/classes/helper/html/forms/class_HtmlFormHelper.php:116: * @todo Add some unique PIN here to bypass problems with some browser and/or extensions +./framework/main/classes/helper/html/forms/class_HtmlFormHelper.php:629: * @todo Add checking if sub option is already added +./framework/main/classes/helper/html/forms/class_HtmlFormHelper.php:657: * @todo Add checking if sub option is already added +./framework/main/classes/helper/html/forms/class_HtmlFormHelper.php:691: // @TODO We need to log this later +./framework/main/classes/helper/html/forms/class_HtmlFormHelper.php:860: * @todo Implement check if rules have been changed ./framework/main/classes/helper/html/links/class_HtmlLinkHelper.php:195: * @todo Completely unimplemented ./framework/main/classes/images/class_BaseImage.php:179: * @todo Find something usefull for this method. ./framework/main/classes/images/class_BaseImage.php:189: * @todo Find something usefull for this method. @@ -77,11 +79,12 @@ ./framework/main/classes/images/class_BaseImage.php:257: * @todo Find something usefull for this method. ./framework/main/classes/images/class_BaseImage.php:268: * @todo Find something usefull for this method. ./framework/main/classes/images/class_BaseImage.php:278: * @todo Find something usefull for this method. +./framework/main/classes/images/extended/class_PngImage.php:69: * @todo Rewrite this to SplFileInfo/Object ./framework/main/classes/index/class_BaseIndex.php:160: * @todo Currently the index file is not cached, please implement a memory-handling class and if enough RAM is found, cache the whole index file. -./framework/main/classes/lists/class_BaseList.php:318: // @TODO Extend this somehow? +./framework/main/classes/language/class_LanguageSystem.php:73: * @throws InvalidArgumentException If languageBasePath remains empty (@TODO Get rid of that old-lost code) ./framework/main/classes/lists/groups/class_ListGroupList.php:68: * @todo 0% done ./framework/main/classes/mailer/debug/class_DebugMailer.php:137: * @todo 0% done -./framework/main/classes/menu/class_BaseMenu.php:75: // Log exception @TODO Maybe to intrusive? +./framework/main/classes/menu/class_BaseMenu.php:76: // Log exception @TODO Maybe to intrusive? ./framework/main/classes/output/console/class_ConsoleOutput.php:65: // @TODO Need to rewrite this to $requestInstance->addHeader() ./framework/main/classes/parser/xml/class_XmlParser.php:87: // @TODO We need to find a fallback solution here ./framework/main/classes/points/class_UserPoints.php:112: * @todo Finish loading part of points @@ -97,34 +100,33 @@ ./framework/main/classes/response/image/class_ImageResponse.php:93: * @todo Why are these parameters conflicting? ./framework/main/classes/response/image/class_ImageResponse.php:94: * @todo If the return statement is removed and setcookie() commented out, ./framework/main/classes/response/image/class_ImageResponse.php:95: * @todo this will send only one cookie out, the first one. -./framework/main/classes/rng/class_RandomNumberGenerator.php:104: * @todo Add site key for stronger salt! -./framework/main/classes/rng/class_RandomNumberGenerator.php:182: * @todo I had a better random number generator here but now it is somewhere lost :( -./framework/main/classes/stacker/file/class_BaseFileStack.php:171: * @todo Currently the stack file is not cached, please implement a memory-handling class and if enough RAM is found, cache the whole stack file. -./framework/main/classes/stacker/file/class_BaseFileStack.php:346: // @TODO Please implement this, returning false -./framework/main/classes/stacker/file/class_BaseFileStack.php:69: * @todo To hard assertions here, better rewrite them to exceptions +./framework/main/classes/rng/class_RandomNumberGenerator.php:105: * @todo Add site key for stronger salt! +./framework/main/classes/rng/class_RandomNumberGenerator.php:183: * @todo I had a better random number generator here but now it is somewhere lost :( +./framework/main/classes/stacker/file/class_BaseFileStack.php:172: * @todo Currently the stack file is not cached, please implement a memory-handling class and if enough RAM is found, cache the whole stack file. +./framework/main/classes/stacker/file/class_BaseFileStack.php:347: // @TODO Please implement this, returning false +./framework/main/classes/stacker/file/class_BaseFileStack.php:70: * @todo To hard assertions here, better rewrite them to exceptions ./framework/main/classes/streams/crypto/class_McryptStream.php:18: * @todo mcrypt will become deprecated, rewrite to OpenSSL ./framework/main/classes/streams/crypto/class_OpenSslStream.php:138: // @TODO unfinished ./framework/main/classes/streams/crypto/class_OpenSslStream.php:68: // @TODO unfinished -./framework/main/classes/template/class_BaseTemplateEngine.php:1065: // @TODO This silent abort should be logged, maybe. -./framework/main/classes/template/class_BaseTemplateEngine.php:1073: // @TODO Old behaviour, will become obsolete! -./framework/main/classes/template/class_BaseTemplateEngine.php:1076: // @TODO Yet another old way -./framework/main/classes/template/class_BaseTemplateEngine.php:1299: * @todo Make this code some nicer... -./framework/main/classes/template/class_BaseTemplateEngine.php:962: * @todo Unfinished work or don't die here. -./framework/main/classes/template/class_BaseTemplateEngine.php:987: // @TODO Non-string found so we need some deeper analysis... -./framework/main/classes/template/console/class_ConsoleTemplateEngine.php:21: * @todo This template engine does not make use of setTemplateType() -./framework/main/classes/template/image/class_ImageTemplateEngine.php:231: * @todo Find something usefull with this! -./framework/main/classes/template/image/class_ImageTemplateEngine.php:251: * @todo Add cache creation here -./framework/main/classes/template/mail/class_MailTemplateEngine.php:244: * @todo Add cache creation here -./framework/main/classes/template/mail/class_MailTemplateEngine.php:24: * @todo This template engine does not make use of setTemplateType() -./framework/main/classes/template/mail/class_MailTemplateEngine.php:254: * @todo Should we call back the mailer class here? -./framework/main/classes/template/mail/class_MailTemplateEngine.php:333: * @todo 0% done -./framework/main/classes/template/menu/class_MenuTemplateEngine.php:319: * @todo Find something useful with this! -./framework/main/classes/template/menu/class_MenuTemplateEngine.php:365: * @todo Add cache creation here -./framework/main/classes/tools/console/class_ConsoleTools.php:167: * @todo This should be connected to a caching class to cache DNS requests -./framework/main/classes/tools/console/class_ConsoleTools.php:192: // @TODO Here should the cacher be implemented -./framework/main/classes/tools/console/class_ConsoleTools.php:290: * @todo This should be moved out to an external class, e.g. HttpClient -./framework/main/classes/tools/console/class_ConsoleTools.php:291: * @todo Make IP, host name, port and script name configurable -./framework/main/classes/tools/console/class_ConsoleTools.php:298: // @TODO Add some DNS caching here +./framework/main/classes/template/class_BaseTemplateEngine.php:1070: // @TODO This silent abort should be logged, maybe. +./framework/main/classes/template/class_BaseTemplateEngine.php:1078: // @TODO Old behaviour, will become obsolete! +./framework/main/classes/template/class_BaseTemplateEngine.php:1081: // @TODO Yet another old way +./framework/main/classes/template/class_BaseTemplateEngine.php:1304: * @todo Make this code some nicer... +./framework/main/classes/template/class_BaseTemplateEngine.php:967: * @todo Unfinished work or don't die here. +./framework/main/classes/template/class_BaseTemplateEngine.php:992: // @TODO Non-string found so we need some deeper analysis... +./framework/main/classes/template/console/class_ConsoleTemplateEngine.php:22: * @todo This template engine does not make use of setTemplateType() +./framework/main/classes/template/image/class_ImageTemplateEngine.php:233: * @todo Find something usefull with this! +./framework/main/classes/template/image/class_ImageTemplateEngine.php:253: * @todo Add cache creation here +./framework/main/classes/template/mail/class_MailTemplateEngine.php:245: * @todo Add cache creation here +./framework/main/classes/template/mail/class_MailTemplateEngine.php:255: * @todo Should we call back the mailer class here? +./framework/main/classes/template/mail/class_MailTemplateEngine.php:25: * @todo This template engine does not make use of setTemplateType() +./framework/main/classes/template/menu/class_MenuTemplateEngine.php:321: * @todo Find something useful with this! +./framework/main/classes/template/menu/class_MenuTemplateEngine.php:367: * @todo Add cache creation here +./framework/main/classes/tools/console/class_ConsoleTools.php:179: * @todo This should be connected to a caching class to cache DNS requests +./framework/main/classes/tools/console/class_ConsoleTools.php:207: // @TODO Here should the cacher be implemented +./framework/main/classes/tools/console/class_ConsoleTools.php:308: * @todo This should be moved out to an external class, e.g. HttpClient +./framework/main/classes/tools/console/class_ConsoleTools.php:309: * @todo Make IP, host name, port and script name configurable +./framework/main/classes/tools/console/class_ConsoleTools.php:316: // @TODO Add some DNS caching here ./framework/main/classes/user/class_BaseUser.php:320: * @todo Try to make this method more generic so we can move it in BaseFrameworkSystem ./framework/main/classes/user/class_BaseUser.php:92: * @todo Find a way of casting here. "(int)" might destroy the user id > 32766 ./framework/main/classes/user/guest/class_Guest.php:55: * @todo Add more ways over creating user classes @@ -133,7 +135,6 @@ ./framework/main/exceptions/config/class_ConfigValueTypeUnsupportedException.php:18: * @todo These are invalid argument exceptions ./framework/main/exceptions/config/class_NoConfigEntryException.php:16: * @todo Rename this class to NoFoundEntryException ./framework/main/exceptions/language/class_LanguagePathIsNoDirectoryException.php:16: * @todo Don't use this anymore -./framework/main/exceptions/main/class_MissingMethodException.php:19: * @todo Try to rewrite user/guest login classes and mark this exception as deprecated ./framework/main/exceptions/socket/class_NoSocketErrorDetectedException.php:15: * @todo Those are logic exceptions and should be rewritten ./framework/main/exceptions/user/class_UserNoGuestException.php:17: * @todo Better rename this ./framework/main/interfaces/application/class_ManageableApplication.php:79: * @todo Nothing to add? @@ -146,8 +147,8 @@ ./framework/main/interfaces/visitor/decorator/class_DecoratorVisitor.php:37: * @todo Find interface for this type-hint (only interface/array as type-hints rule) ./framework/main/middleware/compressor/class_CompressorChannel.php:121: // @TODO Is there a configurable fall-back compressor needed, or is NullCompressor okay? ./framework/main/middleware/database/class_DatabaseConnection.php:70: * @todo $debugInstance is currently not used -./framework/main/middleware/debug/class_DebugMiddleware.php:128: // @TODO Initialization phase -./framework/main/middleware/io/class_FileIoHandler.php:186: * @todo 0% done +./framework/main/middleware/debug/class_DebugMiddleware.php:125: // @TODO Initialization phase +./framework/main/middleware/io/class_FileIoHandler.php:189: * @todo 0% done ./framework/main/tests/filter/tests/configuration/classes/class_TestConfigurationLoadableClassesFilter.php:66: * @todo 0% done ./framework/main/tests/filter/tests/requirements/class_TestsPhpRequirementsFilter.php:63: * @todo 0% done ./framework/main/third_party/api/wernisportal/class_WernisApi.php:16: * @todo Out-dated since 0.6-BETA @@ -159,45 +160,47 @@ ./application/tests/starter.php:2:// @DEPRECATED ./framework/classes.php:2:// @DEPRECATED ./framework/config/config-hubmaster.php:2:// @DEPRECATED -./framework/config-global.php:54:// @DEPRECATED As PHP is deprecating this ./framework/database/lib-lfdb.php:2:// @DEPRECATED ./framework/database.php:2:// @DEPRECATED ./framework/includes.php:2:// @DEPRECATED -./framework/main/classes/class_BaseFrameworkSystem.php:1865: * @deprecated Not fully, as the new Logger facilities are not finished yet. +./framework/main/classes/class_BaseFrameworkSystem.php:1846: * @deprecated Not fully, as the new Logger facilities are not finished yet. ./framework/main/exceptions/base64/class_Base64EncodingBadException.php:17: * @deprecated Don't use this anymore ./framework/main/exceptions/base64/class_Base64EncodingModuloException.php:16: * @deprecated Don't use this anymore +./framework/main/exceptions/config/class_ConfigEntryIsEmptyException.php:2:// @DEPRECATED ./framework/main/exceptions/crypto/class_EncryptInvalidLengthException.php:17: * @deprecated Don't use this anymore ./framework/main/exceptions/crypto/class_EncryptMissingException.php:17: * @deprecated Don't use this anymore -./framework/main/exceptions/database/local_file/class_SavePathIsEmptyException.php:16: * @deprecated Please don't use this anymore. -./framework/main/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php:13: * @deprecated Don't use this -./framework/main/exceptions/database/local_file/class_SavePathReadProtectedException.php:13: * @deprecated Please don't use this -./framework/main/exceptions/database/local_file/class_SavePathWriteProtectedException.php:13: * @deprecated Please don't use this -./framework/main/exceptions/file_directory/class_FileIsEmptyException.php:16: * @deprecated Don't use this anymore +./framework/main/exceptions/database/local_file/class_SavePathIsEmptyException.php:2:// @DEPRECATED +./framework/main/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php:16: * @deprecated Don't use this +./framework/main/exceptions/database/local_file/class_SavePathReadProtectedException.php:16: * @deprecated Please don't use this +./framework/main/exceptions/database/local_file/class_SavePathWriteProtectedException.php:16: * @deprecated Please don't use this +./framework/main/exceptions/file_directory/class_FileIsEmptyException.php:2:// @DEPRECATED ./framework/main/exceptions/file_directory/class_InvalidDataLengthException.php:16: * @deprecated Don't use this anymore ./framework/main/exceptions/file_directory/class_InvalidMD5ChecksumException.php:16: * @deprecated Don't use this anymore +./framework/main/exceptions/file_directory/class_PathIsEmptyException.php:2:// @DEPRECATED ./framework/main/exceptions/file_directory/class_PathIsNoDirectoryException.php:16: * @deprecated Don't use this anymore ./framework/main/exceptions/file_directory/class_PathReadProtectedException.php:16: * @deprecated Don't use this anymore ./framework/main/exceptions/filter/class_InvalidFilterChainException.php:16: * @deprecated Don't use this anymore ./framework/main/exceptions/helper/class_FormClosedException.php:17: * @deprecated Don't use this anymore ./framework/main/exceptions/helper/class_FormGroupClosedException.php:16: * @deprecated Don't use this anymore -./framework/main/exceptions/helper/class_FormOpenedException.php:17: * @deprecated Don't use this anymore +./framework/main/exceptions/helper/class_FormOpenedException.php:18: * @deprecated Don't use this anymore ./framework/main/exceptions/helper/class_HelperGroupAlreadyCreatedException.php:16: * @deprecated Don't use this anymore ./framework/main/exceptions/helper/class_HelperNoPreviousOpenedSubGroupException.php:16: * @deprecated Don't use this anymore ./framework/main/exceptions/helper/class_HelperSubGroupAlreadyCreatedException.php:16: * @deprecated Don't use this anymore -./framework/main/exceptions/helper/class_InvalidFormNameException.php:16: * @deprecated Don't use this anymore +./framework/main/exceptions/helper/class_InvalidFormNameException.php:17: * @deprecated Don't use this anymore ./framework/main/exceptions/helper/class_NoGroupOpenedException.php:16: * @deprecated Don't use this anymore ./framework/main/exceptions/helper/class_UserInstanceMissingException.php:16: * @deprecated Don't use this anymore ./framework/main/exceptions/language/class_InvalidLanguagePathStringException.php:16: * @deprecated Don't use this anymore +./framework/main/exceptions/language/class_LanguagePathIsEmptyException.php:2:// @DEPRECATED ./framework/main/exceptions/language/class_LanguagePathReadProtectedException.php:16: * @deprecated Don't use this anymore -./framework/main/exceptions/main/class_DimNotFoundInArrayException.php:16: * @deprecated Please don't use this anymore +./framework/main/exceptions/main/class_DimNotFoundInArrayException.php:17: * @deprecated Please don't use this anymore +./framework/main/exceptions/main/class_EmptyVariableException.php:2:// @DEPRECATED ./framework/main/exceptions/main/class_InvalidArrayCountException.php:16: * @deprecated Don't use this anymore -./framework/main/exceptions/main/class_InvalidClassNameException.php:16: * @deprecated Don't use this anymore +./framework/main/exceptions/main/class_InvalidClassNameException.php:17: * @deprecated Don't use this anymore ./framework/main/exceptions/main/class_InvalidCommandInstanceException.php:2:// @DEPRECATED ./framework/main/exceptions/main/class_InvalidObjectException.php:17: * @deprecated Don't use this anymore ./framework/main/exceptions/main/class_MissingDecimalsThousandsSeparatorException.php:16: * @deprecated Don't use this anymore -./framework/main/exceptions/main/class_MissingMethodException.php:20: * @deprecated Please do no longer use this exception +./framework/main/exceptions/main/class_MissingMethodException.php:2:// @DEPRECATED ./framework/main/exceptions/main/class_VariableIsNotSetException.php:16: * @deprecated Don't use this anymore -./framework/main/exceptions/socket/class_SocketAlreadyRegisteredException.php:14: * @deprecated Don't use this anymore ./framework/main/exceptions/stacker/class_EmptyStackerException.php:16: * @deprecated Don't use this anymore ./framework/main/exceptions/template/class_BasePathIsEmptyException.php:2:// @DEPRECATED ./framework/main/exceptions/template/class_BasePathReadProtectedException.php:16: * @deprecated Don't use this anymore diff --git a/framework/main/classes/factories/objects/class_ObjectFactory.php b/framework/main/classes/factories/objects/class_ObjectFactory.php index 2701ede9..ab8e9ced 100644 --- a/framework/main/classes/factories/objects/class_ObjectFactory.php +++ b/framework/main/classes/factories/objects/class_ObjectFactory.php @@ -4,7 +4,6 @@ namespace CoreFramework\Factory; // Import framework stuff use CoreFramework\Bootstrap\FrameworkBootstrap; -use CoreFramework\Generic\EmptyVariableException; use CoreFramework\Loader\NoClassException; // Import SPL stuff @@ -53,8 +52,7 @@ class ObjectFactory extends BaseFactory { * @param $args Arguments in an indexed array * @return $objectInstance An instance of the requested object * @throws NoClassException If the requested class was not found - * @throws EmptyVariableException If a variable is empty unexpectly - * @throws InvalidArgumentException If class name is not following naming-convention + * @throws InvalidArgumentException If className is empty or the name not following naming-convention */ public static final function createObjectByName ($className, array $args = array()) { // First get an instance of this factory @@ -66,7 +64,7 @@ class ObjectFactory extends BaseFactory { // Is the class name valid and is the class there? if (empty($className)) { // Throw an exception here - throw new EmptyVariableException(array($factoryInstance, 'className'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new InvalidArgumentException('Parameter "className" is empty'); } elseif (!class_exists($className)) { // Then throw an exception throw new NoClassException(array($factoryInstance, $className), self::EXCEPTION_CLASS_NOT_FOUND); diff --git a/framework/main/classes/helper/html/forms/class_HtmlFormHelper.php b/framework/main/classes/helper/html/forms/class_HtmlFormHelper.php index aee395fb..dc5e7f37 100644 --- a/framework/main/classes/helper/html/forms/class_HtmlFormHelper.php +++ b/framework/main/classes/helper/html/forms/class_HtmlFormHelper.php @@ -5,12 +5,14 @@ namespace CoreFramework\Helper; // Import framework stuff use CoreFramework\Database\Frontend\User\UserDatabaseWrapper; use CoreFramework\Factory\ObjectFactory; -use CoreFramework\Generic\EmptyVariableException; use CoreFramework\Generic\NullPointerException; use CoreFramework\Helper\Template\HelpableTemplate; use CoreFramework\Registry\Registry; use CoreFramework\Template\CompileableTemplate; +// Import SPL stuff +use \InvalidArgumentException; + /** * A helper for constructing web forms * @@ -380,19 +382,16 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate { * @param $groupText Text including HTML to show above this group * @return void * @throws FormClosedException If no form has been opened before - * @throws EmptyVariableException If $groupId is not set + * @throws InvalidArgumentException If $groupId is not set */ public function addFormGroup ($groupId = '', $groupText = '') { // Is a form opened? if (($this->formOpened === false) && ($this->formEnabled === true)) { // Throw exception here throw new FormClosedException(array($this, $groupId), self::EXCEPTION_CLOSED_FORM); - } // END - if - - // At least the group name should be set - if ((empty($groupId)) && ($this->ifGroupOpenedPreviously() === false)) { + } elseif ((empty($groupId)) && ($this->ifGroupOpenedPreviously() === false)) { // Throw exception here - throw new EmptyVariableException(array($this, 'groupId'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new InvalidArgumentException('Parameter "groupId" is empty but group is not closed'); } elseif (empty($groupId)) { // Close the last opened $groupId = $this->getPreviousGroupId(); @@ -455,19 +454,16 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate { * @param $subGroupText Text including HTML to show above this group * @return void * @throws FormFormClosedException If no group has been opened before - * @throws EmptyVariableException If $subGroupId is not set + * @throws InvalidArgumentException If $subGroupId is not set */ public function addFormSubGroup ($subGroupId = '', $subGroupText = '') { // Is a group opened? if ($this->ifGroupOpenedPreviously() === false) { // Throw exception here throw new FormFormClosedException(array($this, $subGroupId), self::EXCEPTION_UNEXPECTED_CLOSED_GROUP); - } // END - if - - // At least the sub group name should be set - if ((empty($subGroupId)) && ($this->ifSubGroupOpenedPreviously() === false)) { + } elseif ((empty($subGroupId)) && ($this->ifSubGroupOpenedPreviously() === false)) { // Throw exception here - throw new EmptyVariableException(array($this, 'subGroupId'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new InvalidArgumentException('Parameter "subGroupId" is empty but sub-group is not closed'); } elseif (empty($subGroupId)) { // Close the last opened $subGroupId = $this->getPreviousSubGroupId(); diff --git a/framework/main/classes/resolver/action/class_BaseActionResolver.php b/framework/main/classes/resolver/action/class_BaseActionResolver.php index bec3e14b..908ae590 100644 --- a/framework/main/classes/resolver/action/class_BaseActionResolver.php +++ b/framework/main/classes/resolver/action/class_BaseActionResolver.php @@ -4,9 +4,11 @@ namespace CoreFramework\Resolver\Action; // Import framework stuff use CoreFramework\Factory\ObjectFactory; -use CoreFramework\Generic\EmptyVariableException; use CoreFramework\Resolver\BaseResolver; +// Import SPL stuff +use \InvalidArgumentException; + /** * A generic action resolver class * @@ -71,7 +73,7 @@ class BaseActionResolver extends BaseResolver { * @param $namespace Namespace to look in * @param $actionName The default action we shall execute * @return $isValid Whether the given action is valid - * @throws EmptyVariableException Thrown if given action is not set + * @throws InvalidArgumentException Thrown if given action is not set */ public function isActionValid ($namespace, $actionName) { // By default nothing shall be valid @@ -80,11 +82,11 @@ class BaseActionResolver extends BaseResolver { // Is a action set? if (empty($namespace)) { // Then thrown an exception here - throw new EmptyVariableException(array($this, 'namespace'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new InvalidArgumentException('Parameter "namespace" is empty'); } elseif (empty($actionName)) { // Then thrown an exception here - throw new EmptyVariableException(array($this, 'actionName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); - } // END - if + throw new InvalidArgumentException('Parameter "actionName" is empty'); + } // Create class name $className = sprintf( diff --git a/framework/main/classes/resolver/action/html/class_HtmlActionResolver.php b/framework/main/classes/resolver/action/html/class_HtmlActionResolver.php index aaee84f4..e6ca1fa1 100644 --- a/framework/main/classes/resolver/action/html/class_HtmlActionResolver.php +++ b/framework/main/classes/resolver/action/html/class_HtmlActionResolver.php @@ -3,10 +3,12 @@ namespace CoreFramework\Resolver\Action; // Import framework stuff -use CoreFramework\Generic\EmptyVariableException; use CoreFramework\Manager\ManageableApplication; use CoreFramework\Request\Requestable; +// Import SPL stuff +use \InvalidArgumentException; + /** * A action resolver for local (non-hubbed) actions * @@ -54,7 +56,7 @@ class HtmlActionResolver extends BaseActionResolver implements ActionResolver { * @param $actionName The default action we shall execute * @param $applicationInstance An instance of a manageable application helper class * @return $resolverInstance The prepared action resolver instance - * @throws EmptyVariableException Thrown if default action is not set + * @throws InvalidArgumentException Thrown if default action is not set * @throws InvalidActionException Thrown if default action is invalid */ public static final function createHtmlActionResolver ($actionName, ManageableApplication $applicationInstance) { @@ -64,7 +66,7 @@ class HtmlActionResolver extends BaseActionResolver implements ActionResolver { // Is the variable $actionName set and the action is valid? if (empty($actionName)) { // Then thrown an exception here - throw new EmptyVariableException(array($resolverInstance, 'defaultAction'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new InvalidArgumentException('Parameter "actionName" is empty'); } elseif ($resolverInstance->isActionValid($actionName) === false) { // Invalid action found throw new InvalidActionException(array($resolverInstance, $actionName), self::EXCEPTION_INVALID_ACTION); diff --git a/framework/main/classes/resolver/command/class_BaseCommandResolver.php b/framework/main/classes/resolver/command/class_BaseCommandResolver.php index a6d015cc..0db8170f 100644 --- a/framework/main/classes/resolver/command/class_BaseCommandResolver.php +++ b/framework/main/classes/resolver/command/class_BaseCommandResolver.php @@ -7,11 +7,11 @@ use CoreFramework\Bootstrap\FrameworkBootstrap; use CoreFramework\Command\Commandable; use CoreFramework\Command\InvalidCommandException; use CoreFramework\Factory\ObjectFactory; -use CoreFramework\Generic\EmptyVariableException; use CoreFramework\Request\Requestable; use CoreFramework\Resolver\BaseResolver; // Import SPL stuff +use \InvalidArgumentException; use \UnexpectedValueException; /** @@ -163,7 +163,7 @@ class BaseCommandResolver extends BaseResolver { * @param $namespace Namespace to look in * @param $commandName The default command we shall execute * @return $isValid Whether the given command is valid - * @throws EmptyVariableException Thrown if given command is not set + * @throws InvalidArgumentException Thrown if given command is not set */ protected function isCommandValid ($namespace, $commandName) { // By default nothing shall be valid @@ -172,10 +172,10 @@ class BaseCommandResolver extends BaseResolver { // Is namespace and command name set? if (empty($namespace)) { // Then thrown an exception here - throw new EmptyVariableException(array($this, 'namespace'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new InvalidArgumentException('Parameter "namespace" is empty'); } elseif (empty($commandName)) { // Then thrown an exception here - throw new EmptyVariableException(array($this, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new InvalidArgumentException('Parameter "commandName" is empty'); } // END - if // Create the full class name diff --git a/framework/main/classes/resolver/command/console/class_ConsoleCommandResolver.php b/framework/main/classes/resolver/command/console/class_ConsoleCommandResolver.php index 17a29204..92840c24 100644 --- a/framework/main/classes/resolver/command/console/class_ConsoleCommandResolver.php +++ b/framework/main/classes/resolver/command/console/class_ConsoleCommandResolver.php @@ -5,10 +5,12 @@ namespace CoreFramework\Resolver\Command; // Import framework stuff use CoreFramework\Command\BaseCommand; use CoreFramework\Command\InvalidCommandException; -use CoreFramework\Generic\EmptyVariableException; use CoreFramework\Manager\ManageableApplication; use CoreFramework\Resolver\Command\CommandResolver; +// Import SPL stuff +use \InvalidArgumentException; + /** * A command resolver for local (non-hubbed) web commands * @@ -51,7 +53,7 @@ class ConsoleCommandResolver extends BaseCommandResolver implements CommandResol * @param $commandName The default command we shall execute * @param $applicationInstance An instance of a manageable application helper class * @return $resolverInstance The prepared command resolver instance - * @throws EmptyVariableException Thrown if default command is not set + * @throws InvalidArgumentException Thrown if default command is not set * @throws InvalidCommandException Thrown if default command is invalid */ public static final function createConsoleCommandResolver ($commandName, ManageableApplication $applicationInstance) { @@ -61,7 +63,7 @@ class ConsoleCommandResolver extends BaseCommandResolver implements CommandResol // Is the variable $commandName set and the command is valid? if (empty($commandName)) { // Then thrown an exception here - throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new InvalidArgumentException('Parameter "commandName" is empty'); } elseif ($resolverInstance->isCommandValid($commandName) === false) { // Invalid command found throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND); diff --git a/framework/main/classes/resolver/command/html/class_HtmlCommandResolver.php b/framework/main/classes/resolver/command/html/class_HtmlCommandResolver.php index 2ed244b0..631d4153 100644 --- a/framework/main/classes/resolver/command/html/class_HtmlCommandResolver.php +++ b/framework/main/classes/resolver/command/html/class_HtmlCommandResolver.php @@ -4,10 +4,12 @@ namespace CoreFramework\Resolver\Command; // Import framework stuff use CoreFramework\Command\InvalidCommandException; -use CoreFramework\Generic\EmptyVariableException; use CoreFramework\Manager\ManageableApplication; use CoreFramework\Resolver\Command\CommandResolver; +// Import SPL stuff +use \InvalidArgumentException; + /** * A command resolver for local (non-hubbed) HTML commands * @@ -55,7 +57,7 @@ class HtmlCommandResolver extends BaseCommandResolver implements CommandResolver * @param $commandName The default command we shall execute * @param $applicationInstance An instance of a manageable application helper class * @return $resolverInstance The prepared command resolver instance - * @throws EmptyVariableException Thrown if default command is not set + * @throws InvalidArgumentException Thrown if default command is not set * @throws InvalidCommandException Thrown if default command is invalid */ public static final function createHtmlCommandResolver ($commandName, ManageableApplication $applicationInstance) { @@ -65,7 +67,7 @@ class HtmlCommandResolver extends BaseCommandResolver implements CommandResolver // Is the variable $commandName set and the command is valid? if (empty($commandName)) { // Then thrown an exception here - throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new InvalidArgumentException('Parameter "commandName" is empty'); } elseif ($resolverInstance->isCommandValid($commandName) === false) { // Invalid command found throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND); diff --git a/framework/main/classes/resolver/command/image/class_ImageCommandResolver.php b/framework/main/classes/resolver/command/image/class_ImageCommandResolver.php index d053dc52..8eaf68d2 100644 --- a/framework/main/classes/resolver/command/image/class_ImageCommandResolver.php +++ b/framework/main/classes/resolver/command/image/class_ImageCommandResolver.php @@ -4,9 +4,11 @@ namespace CoreFramework\Resolver\Command; // Import framework stuff use CoreFramework\Command\InvalidCommandException; -use CoreFramework\Generic\EmptyVariableException; use CoreFramework\Resolver\Command\CommandResolver; +// Import SPL stuff +use \InvalidArgumentException; + /** * A command resolver for local (non-hubbed) image commands * @@ -54,7 +56,7 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve * @param $commandName The default command we shall execute * @param $applicationInstance An instance of a manageable application helper class * @return $resolverInstance The prepared command resolver instance - * @throws EmptyVariableException Thrown if default command is not set + * @throws InvalidArgumentException Thrown if default command is not set * @throws InvalidCommandException Thrown if default command is invalid */ public static final function createImageCommandResolver ($commandName, ManageableApplication $applicationInstance) { @@ -64,7 +66,7 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve // Is the variable $commandName set and the command is valid? if (empty($commandName)) { // Then thrown an exception here - throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new InvalidArgumentException('Parameter "commandName" is empty'); } elseif ($resolverInstance->isCommandValid($commandName) === false) { // Invalid command found throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND); diff --git a/framework/main/classes/resolver/controller/class_BaseControllerResolver.php b/framework/main/classes/resolver/controller/class_BaseControllerResolver.php index f2a3f3ec..78773b41 100644 --- a/framework/main/classes/resolver/controller/class_BaseControllerResolver.php +++ b/framework/main/classes/resolver/controller/class_BaseControllerResolver.php @@ -6,11 +6,13 @@ namespace CoreFramework\Resolver\Controller; use CoreFramework\Controller\DefaultControllerException; use CoreFramework\Controller\Controller; use CoreFramework\Factory\ObjectFactory; -use CoreFramework\Generic\EmptyVariableException; use CoreFramework\Registry\Registry; use CoreFramework\Resolver\BaseResolver; use CoreFramework\Resolver\Controller\ControllerResolver; +// Import SPL stuff +use \InvalidArgumentException; + /** * A generic controller resolver class * @@ -129,7 +131,7 @@ class BaseControllerResolver extends BaseResolver { * @param $namespace Namespace to look in, no trailing backslash * @param $controllerName The default controller we shall execute * @return $isValid Whether the given controller is valid - * @throws EmptyVariableException Thrown if given controller is not set + * @throws InvalidArgumentException Thrown if given controller is not set * @throws DefaultControllerException Thrown if default controller was not found */ protected function isControllerValid ($namespace, $controllerName) { @@ -139,11 +141,11 @@ class BaseControllerResolver extends BaseResolver { // Is namespace and controller name set? if (empty($namespace)) { // Then thrown an exception here - throw new EmptyVariableException(array($this, 'namespace'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new InvalidArgumentException('Parameter "namespace" is empty'); } elseif (empty($controllerName)) { // Then thrown an exception here - throw new EmptyVariableException(array($this, 'controllerName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); - } // END - if + throw new InvalidArgumentException('Parameter "controllerName" is empty'); + } // Create class name $className = sprintf( diff --git a/framework/main/classes/resolver/controller/console/class_ConsoleControllerResolver.php b/framework/main/classes/resolver/controller/console/class_ConsoleControllerResolver.php index 61743b58..a0e53654 100644 --- a/framework/main/classes/resolver/controller/console/class_ConsoleControllerResolver.php +++ b/framework/main/classes/resolver/controller/console/class_ConsoleControllerResolver.php @@ -4,11 +4,13 @@ namespace CoreFramework\Resolver\Controller; // Import framework stuff use CoreFramework\Controller\BaseController; -use CoreFramework\Generic\EmptyVariableException; use CoreFramework\Manager\ManageableApplication; use CoreFramework\Resolver\Controller\ControllerResolver; use CoreFramework\Resolver\Controller\BaseControllerResolver; +// Import SPL stuff +use \InvalidArgumentException; + /** * A resolver for resolving controllers locally * @@ -52,7 +54,7 @@ class ConsoleControllerResolver extends BaseControllerResolver implements Contro * @param $controllerName The controller we shall resolve * @param $applicationInstance An instance of a manageable application helper class * @return $resolverInstance The prepared controller resolver instance - * @throws EmptyVariableException Thrown if default controller is not set + * @throws InvalidArgumentException Thrown if default controller is not set * @throws InvalidControllerException Thrown if default controller is invalid */ public static final function createConsoleControllerResolver ($namespace, $controllerName, ManageableApplication $applicationInstance) { @@ -60,9 +62,12 @@ class ConsoleControllerResolver extends BaseControllerResolver implements Contro $resolverInstance = new ConsoleControllerResolver(); // Is the variable $controllerName set and the controller is valid? - if (empty($controllerName)) { + if (empty($namespace)) { + // Then thrown an exception here + throw new InvalidArgumentException('Parameter "namespace" is empty'); + } elseif (empty($controllerName)) { // Then thrown an exception here - throw new EmptyVariableException(array($resolverInstance, 'controllerName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new InvalidArgumentException('Parameter "controllerName" is empty'); } elseif ($resolverInstance->isControllerValid($namespace, $controllerName) === false) { // Invalid controller found throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER); diff --git a/framework/main/classes/resolver/controller/html/class_HtmlControllerResolver.php b/framework/main/classes/resolver/controller/html/class_HtmlControllerResolver.php index bf9de8f5..6a9c0c50 100644 --- a/framework/main/classes/resolver/controller/html/class_HtmlControllerResolver.php +++ b/framework/main/classes/resolver/controller/html/class_HtmlControllerResolver.php @@ -4,11 +4,13 @@ namespace CoreFramework\Resolver\Controller; // Import framework stuff use CoreFramework\Controller\BaseController; -use CoreFramework\Generic\EmptyVariableException; use CoreFramework\Manager\ManageableApplication; use CoreFramework\Resolver\Controller\ControllerResolver; use CoreFramework\Resolver\Controller\BaseControllerResolver; +// Import SPL stuff +use \InvalidArgumentException; + /** * A resolver for resolving controllers locally * @@ -52,17 +54,20 @@ class HtmlControllerResolver extends BaseControllerResolver implements Controlle * @param $controllerName The controller we shall resolve * @param $applicationInstance An instance of a manageable application helper class * @return $resolverInstance The prepared controller resolver instance - * @throws EmptyVariableException Thrown if default controller is not set + * @throws InvalidArgumentException Thrown if default controller is not set * @throws InvalidControllerException Thrown if default controller is invalid */ public static final function createHtmlControllerResolver ($namespace, $controllerName, ManageableApplication $applicationInstance) { // Create the new instance $resolverInstance = new HtmlControllerResolver(); - // Is the variable $controllerName set and the controller is valid? - if (empty($controllerName)) { + // Are all parameter set and the controller is valid? + if (empty($namespace)) { + // Then thrown an exception here + throw new InvalidArgumentException('Parameter "namespace" is empty'); + } elseif (empty($controllerName)) { // Then thrown an exception here - throw new EmptyVariableException(array($resolverInstance, 'controllerName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new InvalidArgumentException('Parameter "controllerName" is empty'); } elseif ($resolverInstance->isControllerValid($namespace, $controllerName) === false) { // Invalid controller found throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER); diff --git a/framework/main/classes/resolver/controller/image/class_ImageControllerResolver.php b/framework/main/classes/resolver/controller/image/class_ImageControllerResolver.php index 7ec7c537..8ebacc88 100644 --- a/framework/main/classes/resolver/controller/image/class_ImageControllerResolver.php +++ b/framework/main/classes/resolver/controller/image/class_ImageControllerResolver.php @@ -4,11 +4,13 @@ namespace CoreFramework\Resolver\Controller; // Import framework stuff use CoreFramework\Controller\BaseController; -use CoreFramework\Generic\EmptyVariableException; use CoreFramework\Manager\ManageableApplication; use CoreFramework\Resolver\Controller\ControllerResolver; use CoreFramework\Resolver\Controller\BaseControllerResolver; +// Import SPL stuff +use \InvalidArgumentException; + /** * A resolver for resolving controllers locally * @@ -52,17 +54,20 @@ class ImageControllerResolver extends BaseControllerResolver implements Controll * @param $controllerName The controller we shall resolve * @param $applicationInstance An instance of a manageable application helper class * @return $resolverInstance The prepared controller resolver instance - * @throws EmptyVariableException Thrown if default controller is not set + * @throws InvalidArgumentException Thrown if default controller is not set * @throws InvalidControllerException Thrown if default controller is invalid */ public static final function createImageControllerResolver ($namespace, $controllerName, ManageableApplication $applicationInstance) { // Create the new instance $resolverInstance = new ImageControllerResolver(); - // Is the variable $controllerName set and the controller is valid? - if (empty($controllerName)) { + // Are all parameter set and the controller is valid? + if (empty($namespace)) { + // Then thrown an exception here + throw new InvalidArgumentException('Parameter "namespace" is empty'); + } elseif (empty($controllerName)) { // Then thrown an exception here - throw new EmptyVariableException(array($resolverInstance, 'controllerName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new InvalidArgumentException('Parameter "controllerName" is empty'); } elseif ($resolverInstance->isControllerValid($namespace, $controllerName) === false) { // Invalid controller found throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER); diff --git a/framework/main/classes/template/class_BaseTemplateEngine.php b/framework/main/classes/template/class_BaseTemplateEngine.php index 5ca3c6ad..a4abc51b 100644 --- a/framework/main/classes/template/class_BaseTemplateEngine.php +++ b/framework/main/classes/template/class_BaseTemplateEngine.php @@ -7,12 +7,12 @@ use CoreFramework\Bootstrap\FrameworkBootstrap; use CoreFramework\EntryPoint\ApplicationEntryPoint; use CoreFramework\Factory\ObjectFactory; use CoreFramework\Filesystem\FileNotFoundException; -use CoreFramework\Generic\EmptyVariableException; use CoreFramework\Manager\ManageableApplication; use CoreFramework\Object\BaseFrameworkSystem; use CoreFramework\Response\Responseable; // Import SPL stuff +use \InvalidArgumentException; use \SplFileInfo; /** @@ -1112,7 +1112,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { * @param $variableName The variable we are looking for * @param $value The value we want to store in the variable * @return void - * @throws EmptyVariableException If the variable name is left empty + * @throws InvalidArgumentException If the variable name is left empty */ public final function assignVariable ($variableName, $value) { // Replace all dashes to underscores to match variables with configuration entries @@ -1121,7 +1121,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { // Empty variable found? if (empty($variableName)) { // Throw an exception - throw new EmptyVariableException(array($this, 'variableName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new InvalidArgumentException('Parameter "variableName" is empty'); } // END - if // First search for the variable if it was already added diff --git a/framework/main/exceptions/main/class_EmptyVariableException.php b/framework/main/exceptions/main/class_EmptyVariableException.php index 7366afb3..7d6dceec 100644 --- a/framework/main/exceptions/main/class_EmptyVariableException.php +++ b/framework/main/exceptions/main/class_EmptyVariableException.php @@ -1,50 +1,2 @@ - * @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 . - */ -class EmptyVariableException extends FrameworkException { - /** - * The constructor - * - * @param $msgArray Message array holding all needed data - * @param $code Code number for the exception - * @return void - */ - public function __construct (array $msgArray, $code) { - // Add a message around the missing class - $message = sprintf('[%s:%d] Variable %s is not set.', - $msgArray[0]->__toString(), - $this->getLine(), - $msgArray[1] - ); - - // Call parent constructor - parent::__construct($message, $code); - } - -} +// @DEPRECATED diff --git a/framework/main/exceptions/main/class_MissingMethodException.php b/framework/main/exceptions/main/class_MissingMethodException.php index d6e58533..7d6dceec 100644 --- a/framework/main/exceptions/main/class_MissingMethodException.php +++ b/framework/main/exceptions/main/class_MissingMethodException.php @@ -1,55 +1,2 @@ - * @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 - * @todo Try to rewrite user/guest login classes and mark this exception as deprecated - * @deprecated Please do no longer use this exception - * - * 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 . - */ -class MissingMethodException extends FrameworkException { - /** - * The constructor - * - * @param $classArray Array holding the exception data - * @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] This class has no method %s().', - $classArray[0]->__toString(), - $this->getLine(), - $classArray[1] - ); - - // Call parent constructor - parent::__construct($message, $code); - } - -} +// @DEPRECATED diff --git a/framework/main/interfaces/resolver/actions/class_ActionResolver.php b/framework/main/interfaces/resolver/actions/class_ActionResolver.php index a3f468b9..8fa02662 100644 --- a/framework/main/interfaces/resolver/actions/class_ActionResolver.php +++ b/framework/main/interfaces/resolver/actions/class_ActionResolver.php @@ -50,7 +50,7 @@ interface ActionResolver extends Resolver { * @param $namespace Namespace to check * @param $actionName The default action we shall execute * @return $isValid Whether the given action is valid - * @throws EmptyVariableException Thrown if given action is not set + * @throws InvalidArgumentException Thrown if namespace or action is not set */ function isActionValid ($namespace, $actionName); diff --git a/framework/main/tests/resolver/command/console/class_TestsConsoleCommandResolver.php b/framework/main/tests/resolver/command/console/class_TestsConsoleCommandResolver.php index dab091ea..b424f02e 100644 --- a/framework/main/tests/resolver/command/console/class_TestsConsoleCommandResolver.php +++ b/framework/main/tests/resolver/command/console/class_TestsConsoleCommandResolver.php @@ -4,11 +4,13 @@ namespace CoreFramework\Tests\Resolver\Command; // Import framework stuff use CoreFramework\Command\InvalidCommandException; -use CoreFramework\Generic\EmptyVariableException; use CoreFramework\Manager\ManageableApplication; use CoreFramework\Resolver\Command\BaseCommandResolver; use CoreFramework\Resolver\Command\CommandResolver; +// Import SPL stuff +use \InvalidArgumentException; + /** * A command resolver for console commands * @@ -51,7 +53,7 @@ class TestsConsoleCommandResolver extends BaseCommandResolver implements Command * @param $commandName The default command we shall execute * @param $applicationInstance An instance of a manageable application helper class * @return $resolverInstance The prepared command resolver instance - * @throws EmptyVariableException Thrown if default command is not set + * @throws InvalidArgumentException Thrown if default command is not set * @throws InvalidCommandException Thrown if default command is invalid */ public static final function createTestsConsoleCommandResolver ($commandName, ManageableApplication $applicationInstance) { @@ -61,7 +63,7 @@ class TestsConsoleCommandResolver extends BaseCommandResolver implements Command // Is the variable $commandName set and the command is valid? if (empty($commandName)) { // Then thrown an exception here - throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new InvalidArgumentException('Parameter "commandName" is empty'); } elseif ($resolverInstance->isCommandValid('CoreFramework\Tests\Command', $commandName) === false) { // Invalid command found throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND); diff --git a/framework/main/tests/resolver/controller/class_TestsConsoleControllerResolver.php b/framework/main/tests/resolver/controller/class_TestsConsoleControllerResolver.php index 07521787..e3761edf 100644 --- a/framework/main/tests/resolver/controller/class_TestsConsoleControllerResolver.php +++ b/framework/main/tests/resolver/controller/class_TestsConsoleControllerResolver.php @@ -5,11 +5,13 @@ namespace CoreFramework\Tests\Resolver\Controller; // Import framework stuff use CoreFramework\Controller\BaseController; use CoreFramework\Controller\Controller; -use CoreFramework\Generic\EmptyVariableException; use CoreFramework\Manager\ManageableApplication; use CoreFramework\Resolver\Controller\BaseControllerResolver; use CoreFramework\Resolver\Controller\ControllerResolver; +// Import SPL stuff +use \InvalidArgumentException; + /** * A resolver for resolving controllers locally * @@ -52,7 +54,7 @@ class TestsConsoleControllerResolver extends BaseControllerResolver implements C * @param $controllerName The controller we shall resolve * @param $applicationInstance An instance of a manageable application helper class * @return $resolverInstance The prepared controller resolver instance - * @throws EmptyVariableException Thrown if default command is not set + * @throws InvalidArgumentException Thrown if default command is not set * @throws InvalidControllerException Thrown if default controller is invalid */ public static final function createTestsConsoleControllerResolver ($controllerName, ManageableApplication $applicationInstance) { @@ -62,7 +64,7 @@ class TestsConsoleControllerResolver extends BaseControllerResolver implements C // Is the variable $controllerName set and the command is valid? if (empty($controllerName)) { // Then thrown an exception here - throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new InvalidArgumentException('Parameter "controllerName" is empty'); } elseif ($resolverInstance->isControllerValid('CoreFramework\Tests\Controller', $controllerName) === false) { // Invalid command found throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER); -- 2.39.5