From 157054c97eb9f4b263c5740515639955624a11af Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 21 May 2016 13:49:07 +0200 Subject: [PATCH] Use class constant --- .../acp/action/InstallPackageAction.class.php | 3 +- .../action/UninstallPackageAction.class.php | 3 +- .../acp/action/WorkerProxyAction.class.php | 5 +- .../acp/form/AbstractOptionListForm.class.php | 3 +- .../lib/acp/form/UserOptionListForm.class.php | 3 +- .../acp/page/ACPSessionLogListPage.class.php | 3 +- .../lib/acp/page/ACPSessionLogPage.class.php | 3 +- .../files/lib/acp/page/AdListPage.class.php | 3 +- .../lib/acp/page/AttachmentListPage.class.php | 3 +- .../lib/acp/page/BBCodeListPage.class.php | 3 +- .../BBCodeMediaProviderListPage.class.php | 3 +- .../files/lib/acp/page/BoxListPage.class.php | 3 +- .../page/CaptchaQuestionListPage.class.php | 3 +- .../lib/acp/page/CronjobListPage.class.php | 3 +- .../lib/acp/page/CronjobLogListPage.class.php | 3 +- .../lib/acp/page/LabelGroupListPage.class.php | 3 +- .../lib/acp/page/LanguageListPage.class.php | 3 +- .../files/lib/acp/page/MenuListPage.class.php | 3 +- .../lib/acp/page/NoticeListPage.class.php | 3 +- .../lib/acp/page/PackageListPage.class.php | 3 +- .../PackageUpdateServerListPage.class.php | 3 +- .../files/lib/acp/page/PageListPage.class.php | 3 +- .../page/PaidSubscriptionListPage.class.php | 3 +- ...bscriptionTransactionLogListPage.class.php | 3 +- .../PaidSubscriptionUserListPage.class.php | 3 +- .../lib/acp/page/SmileyListPage.class.php | 3 +- .../lib/acp/page/StyleListPage.class.php | 3 +- .../files/lib/acp/page/TagListPage.class.php | 3 +- .../acp/page/TemplateGroupListPage.class.php | 3 +- .../lib/acp/page/TemplateListPage.class.php | 3 +- ...serAuthenticationFailureListPage.class.php | 3 +- .../UserGroupAssignmentListPage.class.php | 3 +- .../lib/acp/page/UserGroupListPage.class.php | 3 +- .../page/UserOptionCategoryListPage.class.php | 3 +- .../lib/acp/page/UserOptionListPage.class.php | 3 +- .../lib/acp/page/UserRankListPage.class.php | 3 +- .../lib/action/AJAXProxyAction.class.php | 5 +- .../AbstractDatabaseObjectAction.class.php | 2 +- .../lib/data/DatabaseObjectList.class.php | 4 +- .../data/ProcessibleDatabaseObject.class.php | 7 +-- .../data/acl/option/ACLOptionAction.class.php | 2 +- .../ACLOptionCategoryAction.class.php | 2 +- .../acp/menu/item/ACPMenuItemAction.class.php | 2 +- .../log/ACPSessionAccessLogAction.class.php | 2 +- .../session/log/ACPSessionLogAction.class.php | 2 +- .../acp/template/ACPTemplateAction.class.php | 2 +- .../lib/data/bbcode/BBCodeAction.class.php | 2 +- .../attribute/BBCodeAttributeAction.class.php | 2 +- .../BBCodeMediaProviderAction.class.php | 2 +- .../data/category/CategoryNodeTree.class.php | 2 +- .../action/ClipboardActionAction.class.php | 2 +- .../response/CommentResponseAction.class.php | 2 +- .../core/object/CoreObjectAction.class.php | 2 +- .../lib/data/cronjob/CronjobAction.class.php | 2 +- .../lib/data/cronjob/CronjobEditor.class.php | 3 +- .../cronjob/log/CronjobLogAction.class.php | 2 +- .../entry/EditHistoryEntryAction.class.php | 2 +- .../listener/EventListenerAction.class.php | 2 +- .../label/group/LabelGroupAction.class.php | 2 +- .../data/language/LanguageAction.class.php | 2 +- .../category/LanguageCategoryAction.class.php | 2 +- .../item/LanguageItemAction.class.php | 2 +- .../files/lib/data/like/LikeAction.class.php | 2 +- .../queue/ModerationQueueAction.class.php | 2 +- .../object/type/ObjectTypeAction.class.php | 2 +- .../ObjectTypeDefinitionAction.class.php | 2 +- .../lib/data/option/OptionAction.class.php | 2 +- .../category/OptionCategoryAction.class.php | 2 +- .../lib/data/package/PackageAction.class.php | 2 +- .../PackageInstallationPluginAction.class.php | 2 +- .../PackageInstallationQueueAction.class.php | 2 +- .../update/PackageUpdateAction.class.php | 15 +++--- .../PackageUpdateServerAction.class.php | 2 +- .../PackageUpdateVersionAction.class.php | 2 +- .../files/lib/data/poll/PollAction.class.php | 2 +- .../poll/option/PollOptionAction.class.php | 2 +- .../lib/data/search/SearchAction.class.php | 2 +- .../keyword/SearchKeywordAction.class.php | 2 +- .../lib/data/session/SessionAction.class.php | 2 +- .../files/lib/data/sitemap/Sitemap.class.php | 5 +- .../lib/data/smiley/SmileyAction.class.php | 2 +- .../category/SmileyCategoryAction.class.php | 3 +- .../lib/data/spider/SpiderAction.class.php | 2 +- .../data/stat/daily/StatDailyAction.class.php | 2 +- .../lib/data/style/StyleAction.class.php | 2 +- .../lib/data/style/StyleEditor.class.php | 3 +- .../variable/StyleVariableAction.class.php | 2 +- .../files/lib/data/tag/TagAction.class.php | 2 +- .../data/template/TemplateAction.class.php | 2 +- .../lib/data/template/TemplateList.class.php | 2 +- .../group/TemplateGroupAction.class.php | 2 +- .../listener/TemplateListenerAction.class.php | 2 +- .../user/follow/UserFollowingAction.class.php | 2 +- .../data/user/group/UserGroupAction.class.php | 2 +- .../option/UserGroupOptionAction.class.php | 2 +- .../UserGroupOptionCategoryAction.class.php | 2 +- .../ignore/ViewableUserIgnoreList.class.php | 8 +-- .../user/menu/item/UserMenuItem.class.php | 3 +- .../event/UserNotificationEvent.class.php | 3 +- .../user/option/UserOptionAction.class.php | 2 +- .../UserOptionCategoryAction.class.php | 2 +- .../menu/item/UserProfileMenuItem.class.php | 4 +- .../files/lib/page/FollowingPage.class.php | 3 +- .../files/lib/page/IgnoredUsersPage.class.php | 3 +- .../files/lib/page/MembersListPage.class.php | 3 +- .../lib/page/ModerationListPage.class.php | 3 +- .../files/lib/page/MultipleLinkPage.class.php | 5 +- .../files/lib/page/SearchResultPage.class.php | 2 +- .../install/files/lib/system/CLIWCF.class.php | 4 +- .../install/files/lib/system/WCF.class.php | 11 ++-- .../files/lib/system/WCFSetup.class.php | 5 +- .../application/AbstractApplication.class.php | 3 +- .../BackgroundQueueHandler.class.php | 2 +- .../lib/system/bbcode/CodeBBCode.class.php | 50 ++++++++++++------- .../builder/ACPMenuCacheBuilder.class.php | 3 +- .../EventListenerCacheBuilder.class.php | 3 +- .../builder/OptionCacheBuilder.class.php | 3 +- .../builder/SmileyCacheBuilder.class.php | 3 +- .../UserGroupOptionCacheBuilder.class.php | 3 +- .../UserGroupPermissionCacheBuilder.class.php | 4 +- .../builder/UserMenuCacheBuilder.class.php | 3 +- .../builder/UserOptionCacheBuilder.class.php | 3 +- .../builder/UserStatsCacheBuilder.class.php | 3 +- .../cli/command/WorkerCLICommand.class.php | 5 +- .../clipboard/ClipboardHandler.class.php | 5 +- .../action/TagClipboardAction.class.php | 3 +- .../action/UserClipboardAction.class.php | 3 +- .../UserContentClipboardAction.class.php | 3 +- .../system/cronjob/CronjobScheduler.class.php | 4 +- .../lib/system/database/Database.class.php | 5 +- .../system/database/MySQLDatabase.class.php | 3 +- .../database/PostgreSQLDatabase.class.php | 3 +- .../lib/system/event/EventHandler.class.php | 12 ++--- .../MultipleSelectionFormElement.class.php | 3 +- .../lib/system/image/ImageHandler.class.php | 6 ++- .../AbstractAttachmentImporter.class.php | 2 +- .../AbstractCategoryImporter.class.php | 3 +- .../AbstractCommentImporter.class.php | 3 +- .../AbstractCommentResponseImporter.class.php | 3 +- .../importer/AbstractLikeImporter.class.php | 3 +- .../importer/AbstractPollImporter.class.php | 3 +- .../AbstractPollOptionImporter.class.php | 3 +- .../AbstractWatchedObjectImporter.class.php | 3 +- .../importer/LabelGroupImporter.class.php | 3 +- .../system/importer/LabelImporter.class.php | 3 +- .../system/importer/SmileyImporter.class.php | 4 +- .../importer/UserAvatarImporter.class.php | 3 +- .../importer/UserFollowerImporter.class.php | 3 +- .../importer/UserGroupImporter.class.php | 2 +- .../system/importer/UserImporter.class.php | 2 +- .../importer/UserOptionImporter.class.php | 3 +- .../importer/UserRankImporter.class.php | 3 +- .../lib/system/label/LabelHandler.class.php | 3 +- .../AbstractLabelObjectHandler.class.php | 3 +- .../message/QuickReplyManager.class.php | 7 +-- .../AbstractModerationQueueHandler.class.php | 3 +- ...actCategoryMultiSelectOptionType.class.php | 3 +- .../system/option/FileOptionType.class.php | 2 +- .../lib/system/option/OptionHandler.class.php | 7 +-- .../option/user/UserOptionHandler.class.php | 3 +- .../group/UserGroupOptionHandler.class.php | 7 +-- .../system/package/PackageArchive.class.php | 2 +- .../PackageInstallationDispatcher.class.php | 4 +- .../PackageInstallationScheduler.class.php | 6 +-- .../package/PackageUpdateDispatcher.class.php | 2 +- ...LOptionPackageInstallationPlugin.class.php | 3 +- ...ACPMenuPackageInstallationPlugin.class.php | 3 +- ...roviderPackageInstallationPlugin.class.php | 3 +- ...dActionPackageInstallationPlugin.class.php | 3 +- ...eObjectPackageInstallationPlugin.class.php | 3 +- ...CronjobPackageInstallationPlugin.class.php | 2 +- ...istenerPackageInstallationPlugin.class.php | 2 +- ...initionPackageInstallationPlugin.class.php | 3 +- ...ectTypePackageInstallationPlugin.class.php | 3 +- .../PIPPackageInstallationPlugin.class.php | 3 +- ...SitemapPackageInstallationPlugin.class.php | 3 +- .../SmileyPackageInstallationPlugin.class.php | 3 +- .../StylePackageInstallationPlugin.class.php | 2 +- ...istenerPackageInstallationPlugin.class.php | 3 +- ...serMenuPackageInstallationPlugin.class.php | 3 +- ...onEventPackageInstallationPlugin.class.php | 3 +- ...ileMenuPackageInstallationPlugin.class.php | 3 +- .../PackageValidationArchive.class.php | 2 +- .../lib/system/poll/PollManager.class.php | 8 +-- .../lib/system/search/SearchEngine.class.php | 7 +-- .../search/SearchIndexManager.class.php | 3 +- .../search/SearchKeywordManager.class.php | 3 +- .../search/acp/ACPSearchHandler.class.php | 4 +- ...tegorizedACPSearchResultProvider.class.php | 3 +- .../MenuItemACPSearchResultProvider.class.php | 3 +- .../OptionACPSearchResultProvider.class.php | 6 ++- .../PackageACPSearchResultProvider.class.php | 3 +- .../acp/UserACPSearchResultProvider.class.php | 3 +- ...oupOptionACPSearchResultProvider.class.php | 6 ++- .../system/session/SessionHandler.class.php | 3 +- .../lib/system/tagging/TagEngine.class.php | 2 +- .../DefaultUserAuthentication.class.php | 6 +-- .../IUserAuthentication.class.php | 4 +- .../UserAuthenticationFactory.class.php | 6 +-- .../UserNotificationHandler.class.php | 2 +- .../LikeUserNotificationObjectType.class.php | 9 ++-- ...FollowUserNotificationObjectType.class.php | 9 ++-- ...sponseUserNotificationObjectType.class.php | 9 ++-- ...ommentUserNotificationObjectType.class.php | 9 ++-- .../AbstractRebuildDataWorker.class.php | 5 +- .../AttachmentRebuildDataWorker.class.php | 3 +- .../worker/LikeRebuildDataWorker.class.php | 3 +- .../LikeUserRebuildDataWorker.class.php | 3 +- .../worker/SendNewPasswordWorker.class.php | 2 +- .../worker/UserRebuildDataWorker.class.php | 3 +- .../files/lib/util/HeaderUtil.class.php | 4 +- 211 files changed, 446 insertions(+), 294 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php b/wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php index 660891a3d5..5455b9de4a 100755 --- a/wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php +++ b/wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php @@ -1,6 +1,7 @@ prepareStatement($sql); $statement->execute([$packageID]); - $application = $statement->fetchObject('wcf\data\application\Application'); + $application = $statement->fetchObject(Application::class); // build redirect location $location = $application->getPageURL() . 'acp/index.php?package-list/'; diff --git a/wcfsetup/install/files/lib/acp/action/UninstallPackageAction.class.php b/wcfsetup/install/files/lib/acp/action/UninstallPackageAction.class.php index 70591388e8..f854e0fb27 100644 --- a/wcfsetup/install/files/lib/acp/action/UninstallPackageAction.class.php +++ b/wcfsetup/install/files/lib/acp/action/UninstallPackageAction.class.php @@ -1,6 +1,7 @@ prepareStatement($sql); $statement->execute([$packageID]); - $application = $statement->fetchObject('wcf\data\application\Application'); + $application = $statement->fetchObject(Application::class); // build redirect location $location = $application->getPageURL() . 'acp/index.php?package-list/'; diff --git a/wcfsetup/install/files/lib/acp/action/WorkerProxyAction.class.php b/wcfsetup/install/files/lib/acp/action/WorkerProxyAction.class.php index 3c823cb2c3..8c4f6cabc6 100644 --- a/wcfsetup/install/files/lib/acp/action/WorkerProxyAction.class.php +++ b/wcfsetup/install/files/lib/acp/action/WorkerProxyAction.class.php @@ -3,6 +3,7 @@ namespace wcf\acp\action; use wcf\action\AbstractSecureAction; use wcf\action\AJAXInvokeAction; use wcf\system\exception\SystemException; +use wcf\system\worker\IWorker; use wcf\system\WCF; use wcf\util\JSON; @@ -63,8 +64,8 @@ class WorkerProxyAction extends AJAXInvokeAction { throw new SystemException("class name cannot be empty."); } - if (!is_subclass_of($this->className, 'wcf\system\worker\IWorker')) { - throw new SystemException("'".$this->className."' does not implement 'wcf\system\worker\IWorker'"); + if (!is_subclass_of($this->className, IWorker::class)) { + throw new SystemException("'".$this->className."' does not implement '".IWorker::class."'"); } } diff --git a/wcfsetup/install/files/lib/acp/form/AbstractOptionListForm.class.php b/wcfsetup/install/files/lib/acp/form/AbstractOptionListForm.class.php index c4bf1ef69d..c0e78debcf 100755 --- a/wcfsetup/install/files/lib/acp/form/AbstractOptionListForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/AbstractOptionListForm.class.php @@ -2,6 +2,7 @@ namespace wcf\acp\form; use wcf\form\AbstractForm; use wcf\system\exception\UserInputException; +use wcf\system\option\OptionHandler; /** * This class provides default implementations for a list of options. @@ -46,7 +47,7 @@ abstract class AbstractOptionListForm extends AbstractForm { * option handler class name * @var string */ - public $optionHandlerClassName = 'wcf\system\option\OptionHandler'; + public $optionHandlerClassName = OptionHandler::class; /** * true if option supports i18n diff --git a/wcfsetup/install/files/lib/acp/form/UserOptionListForm.class.php b/wcfsetup/install/files/lib/acp/form/UserOptionListForm.class.php index 9eb0f5b426..5419053c73 100644 --- a/wcfsetup/install/files/lib/acp/form/UserOptionListForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserOptionListForm.class.php @@ -2,6 +2,7 @@ namespace wcf\acp\form; use wcf\data\user\group\UserGroup; use wcf\system\language\LanguageFactory; +use wcf\system\option\user\UserOptionHandler; /** * This class provides default implementations for a list of dynamic user options. @@ -17,7 +18,7 @@ abstract class UserOptionListForm extends AbstractOptionListForm { /** * @inheritDoc */ - public $optionHandlerClassName = 'wcf\system\option\user\UserOptionHandler'; + public $optionHandlerClassName = UserOptionHandler::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/acp/page/ACPSessionLogListPage.class.php b/wcfsetup/install/files/lib/acp/page/ACPSessionLogListPage.class.php index a19ea7c1fb..f2109f9f3d 100755 --- a/wcfsetup/install/files/lib/acp/page/ACPSessionLogListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/ACPSessionLogListPage.class.php @@ -1,5 +1,6 @@ className, 'wcf\data\IDatabaseObjectAction')) { - throw new SystemException("'".$this->className."' does not implement 'wcf\data\IDatabaseObjectAction'"); + if (!is_subclass_of($this->className, IDatabaseObjectAction::class)) { + throw new SystemException("'".$this->className."' does not implement '".IDatabaseObjectAction::class."'"); } if (!empty($this->interfaceName)) { diff --git a/wcfsetup/install/files/lib/data/AbstractDatabaseObjectAction.class.php b/wcfsetup/install/files/lib/data/AbstractDatabaseObjectAction.class.php index 4c5919b4d3..951d872ed9 100644 --- a/wcfsetup/install/files/lib/data/AbstractDatabaseObjectAction.class.php +++ b/wcfsetup/install/files/lib/data/AbstractDatabaseObjectAction.class.php @@ -214,7 +214,7 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID * Resets cache of database object. */ protected function resetCache() { - if (is_subclass_of($this->className, 'wcf\data\IEditableCachedObject')) { + if (is_subclass_of($this->className, IEditableCachedObject::class)) { call_user_func([$this->className, 'resetCache']); } } diff --git a/wcfsetup/install/files/lib/data/DatabaseObjectList.class.php b/wcfsetup/install/files/lib/data/DatabaseObjectList.class.php index 0aaaea63eb..748d7a581b 100644 --- a/wcfsetup/install/files/lib/data/DatabaseObjectList.class.php +++ b/wcfsetup/install/files/lib/data/DatabaseObjectList.class.php @@ -121,8 +121,8 @@ abstract class DatabaseObjectList implements \Countable, ITraversableObject { if (!empty($this->decoratorClassName)) { // validate decorator class name - if (!is_subclass_of($this->decoratorClassName, 'wcf\data\DatabaseObjectDecorator')) { - throw new SystemException("'".$this->decoratorClassName."' should extend 'wcf\data\DatabaseObjectDecorator'"); + if (!is_subclass_of($this->decoratorClassName, DatabaseObjectDecorator::class)) { + throw new SystemException("'".$this->decoratorClassName."' should extend '".DatabaseObjectDecorator::class."'"); } $objectClassName = $this->objectClassName ?: $this->className; diff --git a/wcfsetup/install/files/lib/data/ProcessibleDatabaseObject.class.php b/wcfsetup/install/files/lib/data/ProcessibleDatabaseObject.class.php index a93e557166..9bc0d4f995 100644 --- a/wcfsetup/install/files/lib/data/ProcessibleDatabaseObject.class.php +++ b/wcfsetup/install/files/lib/data/ProcessibleDatabaseObject.class.php @@ -1,6 +1,7 @@ className."' does not implement '".static::$processorInterface."'"); } - if (is_subclass_of($this->className, 'wcf\system\SingletonFactory')) { + if (is_subclass_of($this->className, SingletonFactory::class)) { $this->processor = call_user_func([$this->className, 'getInstance']); } else { - if (!is_subclass_of($this->className, 'wcf\data\IDatabaseObjectProcessor')) { - throw new SystemException("'".$this->className."' does not implement 'wcf\data\IDatabaseObjectProcessor'"); + if (!is_subclass_of($this->className, IDatabaseObjectProcessor::class)) { + throw new SystemException("'".$this->className."' does not implement '".IDatabaseObjectProcessor::class."'"); } $this->processor = new $this->className($this); diff --git a/wcfsetup/install/files/lib/data/acl/option/ACLOptionAction.class.php b/wcfsetup/install/files/lib/data/acl/option/ACLOptionAction.class.php index a892031ff8..0fce333d7e 100644 --- a/wcfsetup/install/files/lib/data/acl/option/ACLOptionAction.class.php +++ b/wcfsetup/install/files/lib/data/acl/option/ACLOptionAction.class.php @@ -17,7 +17,7 @@ class ACLOptionAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\acl\option\ACLOptionEditor'; + protected $className = ACLOptionEditor::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/data/acl/option/category/ACLOptionCategoryAction.class.php b/wcfsetup/install/files/lib/data/acl/option/category/ACLOptionCategoryAction.class.php index e8522ddff2..9b2ed408cb 100644 --- a/wcfsetup/install/files/lib/data/acl/option/category/ACLOptionCategoryAction.class.php +++ b/wcfsetup/install/files/lib/data/acl/option/category/ACLOptionCategoryAction.class.php @@ -16,5 +16,5 @@ class ACLOptionCategoryAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\acl\option\category\ACLOptionCategoryEditor'; + protected $className = ACLOptionCategoryEditor::class; } diff --git a/wcfsetup/install/files/lib/data/acp/menu/item/ACPMenuItemAction.class.php b/wcfsetup/install/files/lib/data/acp/menu/item/ACPMenuItemAction.class.php index bd2af37bc2..4f8d416203 100644 --- a/wcfsetup/install/files/lib/data/acp/menu/item/ACPMenuItemAction.class.php +++ b/wcfsetup/install/files/lib/data/acp/menu/item/ACPMenuItemAction.class.php @@ -16,5 +16,5 @@ class ACPMenuItemAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\acp\menu\item\ACPMenuItemEditor'; + protected $className = ACPMenuItemEditor::class; } diff --git a/wcfsetup/install/files/lib/data/acp/session/access/log/ACPSessionAccessLogAction.class.php b/wcfsetup/install/files/lib/data/acp/session/access/log/ACPSessionAccessLogAction.class.php index 9aa8d5e57d..b581c2b55f 100644 --- a/wcfsetup/install/files/lib/data/acp/session/access/log/ACPSessionAccessLogAction.class.php +++ b/wcfsetup/install/files/lib/data/acp/session/access/log/ACPSessionAccessLogAction.class.php @@ -16,5 +16,5 @@ class ACPSessionAccessLogAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\acp\session\access\log\ACPSessionAccessLogEditor'; + protected $className = ACPSessionAccessLogEditor::class; } diff --git a/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLogAction.class.php b/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLogAction.class.php index 8cb33e17d8..9a1d1a21fb 100644 --- a/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLogAction.class.php +++ b/wcfsetup/install/files/lib/data/acp/session/log/ACPSessionLogAction.class.php @@ -16,5 +16,5 @@ class ACPSessionLogAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\acp\session\log\ACPSessionLogEditor'; + protected $className = ACPSessionLogEditor::class; } diff --git a/wcfsetup/install/files/lib/data/acp/template/ACPTemplateAction.class.php b/wcfsetup/install/files/lib/data/acp/template/ACPTemplateAction.class.php index d07f81da3d..f1a20bc434 100644 --- a/wcfsetup/install/files/lib/data/acp/template/ACPTemplateAction.class.php +++ b/wcfsetup/install/files/lib/data/acp/template/ACPTemplateAction.class.php @@ -16,7 +16,7 @@ class ACPTemplateAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\acp\template\ACPTemplateEditor'; + protected $className = ACPTemplateEditor::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/data/bbcode/BBCodeAction.class.php b/wcfsetup/install/files/lib/data/bbcode/BBCodeAction.class.php index 7185725d02..21d68fa704 100644 --- a/wcfsetup/install/files/lib/data/bbcode/BBCodeAction.class.php +++ b/wcfsetup/install/files/lib/data/bbcode/BBCodeAction.class.php @@ -22,7 +22,7 @@ class BBCodeAction extends AbstractDatabaseObjectAction implements IToggleAction /** * @inheritDoc */ - protected $className = 'wcf\data\bbcode\BBCodeEditor'; + protected $className = BBCodeEditor::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/data/bbcode/attribute/BBCodeAttributeAction.class.php b/wcfsetup/install/files/lib/data/bbcode/attribute/BBCodeAttributeAction.class.php index 5c20b2a800..203d423f85 100644 --- a/wcfsetup/install/files/lib/data/bbcode/attribute/BBCodeAttributeAction.class.php +++ b/wcfsetup/install/files/lib/data/bbcode/attribute/BBCodeAttributeAction.class.php @@ -16,5 +16,5 @@ class BBCodeAttributeAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\bbcode\attribute\BBCodeAttributeEditor'; + protected $className = BBCodeAttributeEditor::class; } diff --git a/wcfsetup/install/files/lib/data/bbcode/media/provider/BBCodeMediaProviderAction.class.php b/wcfsetup/install/files/lib/data/bbcode/media/provider/BBCodeMediaProviderAction.class.php index 68af603c99..c18b5a3720 100644 --- a/wcfsetup/install/files/lib/data/bbcode/media/provider/BBCodeMediaProviderAction.class.php +++ b/wcfsetup/install/files/lib/data/bbcode/media/provider/BBCodeMediaProviderAction.class.php @@ -16,7 +16,7 @@ class BBCodeMediaProviderAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\bbcode\media\provider\BBCodeMediaProviderEditor'; + protected $className = BBCodeMediaProviderEditor::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/data/category/CategoryNodeTree.class.php b/wcfsetup/install/files/lib/data/category/CategoryNodeTree.class.php index e40d92cf7b..bdb93cd9e2 100644 --- a/wcfsetup/install/files/lib/data/category/CategoryNodeTree.class.php +++ b/wcfsetup/install/files/lib/data/category/CategoryNodeTree.class.php @@ -168,7 +168,7 @@ class CategoryNodeTree implements \IteratorAggregate { // decorate category if necessary $decoratorClassName = call_user_func([$this->nodeClassName, 'getBaseClass']); - if ($decoratorClassName != 'wcf\data\category\Category') { + if ($decoratorClassName != Category::class) { $category = new $decoratorClassName($category); } diff --git a/wcfsetup/install/files/lib/data/clipboard/action/ClipboardActionAction.class.php b/wcfsetup/install/files/lib/data/clipboard/action/ClipboardActionAction.class.php index 02f230f8ec..182369dd65 100644 --- a/wcfsetup/install/files/lib/data/clipboard/action/ClipboardActionAction.class.php +++ b/wcfsetup/install/files/lib/data/clipboard/action/ClipboardActionAction.class.php @@ -16,5 +16,5 @@ class ClipboardActionAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\clipboard\action\ClipboardActionEditor'; + protected $className = ClipboardActionEditor::class; } diff --git a/wcfsetup/install/files/lib/data/comment/response/CommentResponseAction.class.php b/wcfsetup/install/files/lib/data/comment/response/CommentResponseAction.class.php index 408db25264..e90998826d 100644 --- a/wcfsetup/install/files/lib/data/comment/response/CommentResponseAction.class.php +++ b/wcfsetup/install/files/lib/data/comment/response/CommentResponseAction.class.php @@ -31,7 +31,7 @@ class CommentResponseAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\comment\response\CommentResponseEditor'; + protected $className = CommentResponseEditor::class; /** * comment object diff --git a/wcfsetup/install/files/lib/data/core/object/CoreObjectAction.class.php b/wcfsetup/install/files/lib/data/core/object/CoreObjectAction.class.php index c9d4fac86a..497bd0061f 100644 --- a/wcfsetup/install/files/lib/data/core/object/CoreObjectAction.class.php +++ b/wcfsetup/install/files/lib/data/core/object/CoreObjectAction.class.php @@ -16,5 +16,5 @@ class CoreObjectAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\core\object\CoreObjectEditor'; + protected $className = CoreObjectEditor::class; } diff --git a/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php b/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php index 21d9d67857..52f471384a 100644 --- a/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php +++ b/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php @@ -23,7 +23,7 @@ class CronjobAction extends AbstractDatabaseObjectAction implements IToggleActio /** * @inheritDoc */ - protected $className = 'wcf\data\cronjob\CronjobEditor'; + protected $className = CronjobEditor::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/data/cronjob/CronjobEditor.class.php b/wcfsetup/install/files/lib/data/cronjob/CronjobEditor.class.php index 9bf321638d..6b42606846 100644 --- a/wcfsetup/install/files/lib/data/cronjob/CronjobEditor.class.php +++ b/wcfsetup/install/files/lib/data/cronjob/CronjobEditor.class.php @@ -1,5 +1,6 @@ prepareStatement($sql); $statement->execute(['wcf.acp.cronjob']); - $languageCategory = $statement->fetchObject('wcf\data\language\category\LanguageCategory'); + $languageCategory = $statement->fetchObject(LanguageCategory::class); $languages = new LanguageList(); $languages->readObjects(); diff --git a/wcfsetup/install/files/lib/data/cronjob/log/CronjobLogAction.class.php b/wcfsetup/install/files/lib/data/cronjob/log/CronjobLogAction.class.php index 8f77de50dc..ee073a7296 100644 --- a/wcfsetup/install/files/lib/data/cronjob/log/CronjobLogAction.class.php +++ b/wcfsetup/install/files/lib/data/cronjob/log/CronjobLogAction.class.php @@ -17,7 +17,7 @@ class CronjobLogAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\cronjob\log\CronjobLogEditor'; + protected $className = CronjobLogEditor::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/data/edit/history/entry/EditHistoryEntryAction.class.php b/wcfsetup/install/files/lib/data/edit/history/entry/EditHistoryEntryAction.class.php index 5b6f268575..a50448911a 100644 --- a/wcfsetup/install/files/lib/data/edit/history/entry/EditHistoryEntryAction.class.php +++ b/wcfsetup/install/files/lib/data/edit/history/entry/EditHistoryEntryAction.class.php @@ -18,7 +18,7 @@ class EditHistoryEntryAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\edit\history\entry\EditHistoryEntryEditor'; + protected $className = EditHistoryEntryEditor::class; /** * Checks permissions to revert. diff --git a/wcfsetup/install/files/lib/data/event/listener/EventListenerAction.class.php b/wcfsetup/install/files/lib/data/event/listener/EventListenerAction.class.php index 86f5f94ff6..83dda923cd 100644 --- a/wcfsetup/install/files/lib/data/event/listener/EventListenerAction.class.php +++ b/wcfsetup/install/files/lib/data/event/listener/EventListenerAction.class.php @@ -16,5 +16,5 @@ class EventListenerAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\event\listener\EventListenerEditor'; + protected $className = EventListenerEditor::class; } diff --git a/wcfsetup/install/files/lib/data/label/group/LabelGroupAction.class.php b/wcfsetup/install/files/lib/data/label/group/LabelGroupAction.class.php index b5d1e23632..8847db4970 100644 --- a/wcfsetup/install/files/lib/data/label/group/LabelGroupAction.class.php +++ b/wcfsetup/install/files/lib/data/label/group/LabelGroupAction.class.php @@ -17,7 +17,7 @@ class LabelGroupAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\label\group\LabelGroupEditor'; + protected $className = LabelGroupEditor::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/data/language/LanguageAction.class.php b/wcfsetup/install/files/lib/data/language/LanguageAction.class.php index 8c9a126e7b..ff42f99d59 100644 --- a/wcfsetup/install/files/lib/data/language/LanguageAction.class.php +++ b/wcfsetup/install/files/lib/data/language/LanguageAction.class.php @@ -17,7 +17,7 @@ class LanguageAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\language\LanguageEditor'; + protected $className = LanguageEditor::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/data/language/category/LanguageCategoryAction.class.php b/wcfsetup/install/files/lib/data/language/category/LanguageCategoryAction.class.php index 0227e39541..812475fd17 100644 --- a/wcfsetup/install/files/lib/data/language/category/LanguageCategoryAction.class.php +++ b/wcfsetup/install/files/lib/data/language/category/LanguageCategoryAction.class.php @@ -16,7 +16,7 @@ class LanguageCategoryAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\language\category\LanguageCategoryEditor'; + protected $className = LanguageCategoryEditor::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/data/language/item/LanguageItemAction.class.php b/wcfsetup/install/files/lib/data/language/item/LanguageItemAction.class.php index 8b276b6a2d..50fedbd656 100644 --- a/wcfsetup/install/files/lib/data/language/item/LanguageItemAction.class.php +++ b/wcfsetup/install/files/lib/data/language/item/LanguageItemAction.class.php @@ -20,7 +20,7 @@ class LanguageItemAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\language\item\LanguageItemEditor'; + protected $className = LanguageItemEditor::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/data/like/LikeAction.class.php b/wcfsetup/install/files/lib/data/like/LikeAction.class.php index 13b2d27e4f..f39d835bd9 100644 --- a/wcfsetup/install/files/lib/data/like/LikeAction.class.php +++ b/wcfsetup/install/files/lib/data/like/LikeAction.class.php @@ -33,7 +33,7 @@ class LikeAction extends AbstractDatabaseObjectAction implements IGroupedUserLis /** * @inheritDoc */ - protected $className = 'wcf\data\like\LikeEditor'; + protected $className = LikeEditor::class; /** * likeable object diff --git a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php index f3916c93f2..51811f9e51 100644 --- a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php +++ b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php @@ -26,7 +26,7 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\moderation\queue\ModerationQueueEditor'; + protected $className = ModerationQueueEditor::class; /** * moderation queue editor object diff --git a/wcfsetup/install/files/lib/data/object/type/ObjectTypeAction.class.php b/wcfsetup/install/files/lib/data/object/type/ObjectTypeAction.class.php index c9304bf961..6073861bcd 100644 --- a/wcfsetup/install/files/lib/data/object/type/ObjectTypeAction.class.php +++ b/wcfsetup/install/files/lib/data/object/type/ObjectTypeAction.class.php @@ -16,5 +16,5 @@ class ObjectTypeAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\object\type\ObjectTypeEditor'; + protected $className = ObjectTypeEditor::class; } diff --git a/wcfsetup/install/files/lib/data/object/type/definition/ObjectTypeDefinitionAction.class.php b/wcfsetup/install/files/lib/data/object/type/definition/ObjectTypeDefinitionAction.class.php index cdf3482fc3..433d578c87 100644 --- a/wcfsetup/install/files/lib/data/object/type/definition/ObjectTypeDefinitionAction.class.php +++ b/wcfsetup/install/files/lib/data/object/type/definition/ObjectTypeDefinitionAction.class.php @@ -16,5 +16,5 @@ class ObjectTypeDefinitionAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\object\type\definition\ObjectTypeDefinitionEditor'; + protected $className = ObjectTypeDefinitionEditor::class; } diff --git a/wcfsetup/install/files/lib/data/option/OptionAction.class.php b/wcfsetup/install/files/lib/data/option/OptionAction.class.php index e8de4d02a4..810fb04357 100644 --- a/wcfsetup/install/files/lib/data/option/OptionAction.class.php +++ b/wcfsetup/install/files/lib/data/option/OptionAction.class.php @@ -16,7 +16,7 @@ class OptionAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\option\OptionEditor'; + protected $className = OptionEditor::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/data/option/category/OptionCategoryAction.class.php b/wcfsetup/install/files/lib/data/option/category/OptionCategoryAction.class.php index 24dff29884..d586c65fdf 100644 --- a/wcfsetup/install/files/lib/data/option/category/OptionCategoryAction.class.php +++ b/wcfsetup/install/files/lib/data/option/category/OptionCategoryAction.class.php @@ -16,7 +16,7 @@ class OptionCategoryAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\option\category\OptionCategoryEditor'; + protected $className = OptionCategoryEditor::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/data/package/PackageAction.class.php b/wcfsetup/install/files/lib/data/package/PackageAction.class.php index ee59f60b91..bf53eda8f1 100644 --- a/wcfsetup/install/files/lib/data/package/PackageAction.class.php +++ b/wcfsetup/install/files/lib/data/package/PackageAction.class.php @@ -23,7 +23,7 @@ class PackageAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\package\PackageEditor'; + protected $className = PackageEditor::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/data/package/installation/plugin/PackageInstallationPluginAction.class.php b/wcfsetup/install/files/lib/data/package/installation/plugin/PackageInstallationPluginAction.class.php index 5687693710..6d6642f78e 100644 --- a/wcfsetup/install/files/lib/data/package/installation/plugin/PackageInstallationPluginAction.class.php +++ b/wcfsetup/install/files/lib/data/package/installation/plugin/PackageInstallationPluginAction.class.php @@ -16,5 +16,5 @@ class PackageInstallationPluginAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\package\installation\plugin\PackageInstallationPluginEditor'; + protected $className = PackageInstallationPluginEditor::class; } diff --git a/wcfsetup/install/files/lib/data/package/installation/queue/PackageInstallationQueueAction.class.php b/wcfsetup/install/files/lib/data/package/installation/queue/PackageInstallationQueueAction.class.php index e883d95652..24055a8a01 100644 --- a/wcfsetup/install/files/lib/data/package/installation/queue/PackageInstallationQueueAction.class.php +++ b/wcfsetup/install/files/lib/data/package/installation/queue/PackageInstallationQueueAction.class.php @@ -21,7 +21,7 @@ class PackageInstallationQueueAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\package\installation\queue\PackageInstallationQueueEditor'; + protected $className = PackageInstallationQueueEditor::class; /** * queue of the canceled installation diff --git a/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php b/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php index 8b17951e01..9f51eee7fb 100644 --- a/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php +++ b/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php @@ -3,6 +3,7 @@ namespace wcf\data\package\update; use wcf\data\package\installation\queue\PackageInstallationQueue; use wcf\data\package\installation\queue\PackageInstallationQueueEditor; use wcf\data\package\update\server\PackageUpdateServer; +use wcf\data\package\update\version\PackageUpdateVersion; use wcf\data\package\Package; use wcf\data\search\Search; use wcf\data\search\SearchEditor; @@ -30,7 +31,7 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\package\update\PackageUpdateEditor'; + protected $className = PackageUpdateEditor::class; /** * @inheritDoc @@ -227,8 +228,8 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction { continue; } - uasort($versionTypes['accessible'], ['wcf\data\package\Package', 'compareVersion']); - uasort($versionTypes['existing'], ['wcf\data\package\Package', 'compareVersion']); + uasort($versionTypes['accessible'], [Package::class, 'compareVersion']); + uasort($versionTypes['existing'], [Package::class, 'compareVersion']); $accessibleVersion = array_slice($versionTypes['accessible'], -1, 1, true); $existingVersion = array_slice($versionTypes['existing'], -1, 1, true); @@ -249,8 +250,8 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction { continue; } - uksort($accessible, ['wcf\data\package\Package', 'compareVersion']); - uksort($existing, ['wcf\data\package\Package', 'compareVersion']); + uksort($accessible, [Package::class, 'compareVersion']); + uksort($existing, [Package::class, 'compareVersion']); $accessible = array_pop($accessible); $existing = array_pop($existing); @@ -327,7 +328,7 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction { $statement = WCF::getDB()->prepareStatement($sql, 20, ($this->parameters['pageNo'] - 1) * 20); $statement->execute($conditions->getParameters()); $packageUpdates = $packageVersionIDs = []; - while ($packageUpdate = $statement->fetchObject('wcf\data\package\update\PackageUpdate')) { + while ($packageUpdate = $statement->fetchObject(PackageUpdate::class)) { $packageUpdates[$packageUpdate->packageUpdateID] = new ViewablePackageUpdate($packageUpdate); // collect package version ids @@ -346,7 +347,7 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction { $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); $updateVersions = []; - while ($updateVersion = $statement->fetchObject('wcf\data\package\update\version\PackageUpdateVersion')) { + while ($updateVersion = $statement->fetchObject(PackageUpdateVersion::class)) { $updateVersions[$updateVersion->packageUpdateVersionID] = $updateVersion; } diff --git a/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServerAction.class.php b/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServerAction.class.php index ef7ca93a94..e924c53f01 100644 --- a/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServerAction.class.php +++ b/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServerAction.class.php @@ -17,7 +17,7 @@ class PackageUpdateServerAction extends AbstractDatabaseObjectAction implements /** * @inheritDoc */ - protected $className = 'wcf\data\package\update\server\PackageUpdateServerEditor'; + protected $className = PackageUpdateServerEditor::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/data/package/update/version/PackageUpdateVersionAction.class.php b/wcfsetup/install/files/lib/data/package/update/version/PackageUpdateVersionAction.class.php index 0dae7d368f..9c659c659a 100644 --- a/wcfsetup/install/files/lib/data/package/update/version/PackageUpdateVersionAction.class.php +++ b/wcfsetup/install/files/lib/data/package/update/version/PackageUpdateVersionAction.class.php @@ -16,5 +16,5 @@ class PackageUpdateVersionAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\package\update\version\PackageUpdateVersionEditor'; + protected $className = PackageUpdateVersionEditor::class; } diff --git a/wcfsetup/install/files/lib/data/poll/PollAction.class.php b/wcfsetup/install/files/lib/data/poll/PollAction.class.php index fc63c5d361..b35417e3d6 100644 --- a/wcfsetup/install/files/lib/data/poll/PollAction.class.php +++ b/wcfsetup/install/files/lib/data/poll/PollAction.class.php @@ -29,7 +29,7 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis /** * @inheritDoc */ - protected $className = 'wcf\data\poll\PollEditor'; + protected $className = PollEditor::class; /** * poll object diff --git a/wcfsetup/install/files/lib/data/poll/option/PollOptionAction.class.php b/wcfsetup/install/files/lib/data/poll/option/PollOptionAction.class.php index 742c2adf2d..a2b29f1042 100644 --- a/wcfsetup/install/files/lib/data/poll/option/PollOptionAction.class.php +++ b/wcfsetup/install/files/lib/data/poll/option/PollOptionAction.class.php @@ -16,5 +16,5 @@ class PollOptionAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\poll\option\PollOptionEditor'; + protected $className = PollOptionEditor::class; } diff --git a/wcfsetup/install/files/lib/data/search/SearchAction.class.php b/wcfsetup/install/files/lib/data/search/SearchAction.class.php index 0c56d5a71a..2d0b21206e 100644 --- a/wcfsetup/install/files/lib/data/search/SearchAction.class.php +++ b/wcfsetup/install/files/lib/data/search/SearchAction.class.php @@ -16,5 +16,5 @@ class SearchAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\search\SearchEditor'; + protected $className = SearchEditor::class; } diff --git a/wcfsetup/install/files/lib/data/search/keyword/SearchKeywordAction.class.php b/wcfsetup/install/files/lib/data/search/keyword/SearchKeywordAction.class.php index f0b7477220..4e81403e51 100644 --- a/wcfsetup/install/files/lib/data/search/keyword/SearchKeywordAction.class.php +++ b/wcfsetup/install/files/lib/data/search/keyword/SearchKeywordAction.class.php @@ -18,7 +18,7 @@ class SearchKeywordAction extends AbstractDatabaseObjectAction implements ISearc /** * @inheritDoc */ - protected $className = 'wcf\data\search\keyword\SearchKeywordEditor'; + protected $className = SearchKeywordEditor::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/data/session/SessionAction.class.php b/wcfsetup/install/files/lib/data/session/SessionAction.class.php index f1eeb518e0..5358760c51 100644 --- a/wcfsetup/install/files/lib/data/session/SessionAction.class.php +++ b/wcfsetup/install/files/lib/data/session/SessionAction.class.php @@ -25,7 +25,7 @@ class SessionAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\session\SessionEditor'; + protected $className = SessionEditor::class; /** * list of data values returned upon a keep alive request diff --git a/wcfsetup/install/files/lib/data/sitemap/Sitemap.class.php b/wcfsetup/install/files/lib/data/sitemap/Sitemap.class.php index 1c863170ca..7868b2c1a5 100644 --- a/wcfsetup/install/files/lib/data/sitemap/Sitemap.class.php +++ b/wcfsetup/install/files/lib/data/sitemap/Sitemap.class.php @@ -4,6 +4,7 @@ use wcf\data\DatabaseObject; use wcf\data\TDatabaseObjectOptions; use wcf\data\TDatabaseObjectPermissions; use wcf\system\exception\SystemException; +use wcf\system\sitemap\ISitemapProvider; /** * Represents a sitemap entry. @@ -56,8 +57,8 @@ class Sitemap extends DatabaseObject { throw new SystemException("Unable to find class '".$this->className."' for sitemap '".$this->sitemapName."'"); } - if (!is_subclass_of($this->className, 'wcf\system\sitemap\ISitemapProvider')) { - throw new SystemException("'".$this->className."' does not implement 'wcf\system\sitemap\ISitemapProvider'"); + if (!is_subclass_of($this->className, ISitemapProvider::class)) { + throw new SystemException("'".$this->className."' does not implement '".ISitemapProvider::class."'"); } $this->sitemapObj = new $this->className(); diff --git a/wcfsetup/install/files/lib/data/smiley/SmileyAction.class.php b/wcfsetup/install/files/lib/data/smiley/SmileyAction.class.php index 154efe149a..4105973227 100644 --- a/wcfsetup/install/files/lib/data/smiley/SmileyAction.class.php +++ b/wcfsetup/install/files/lib/data/smiley/SmileyAction.class.php @@ -20,7 +20,7 @@ class SmileyAction extends AbstractDatabaseObjectAction implements ISortableActi /** * @inheritDoc */ - protected $className = 'wcf\data\smiley\SmileyEditor'; + protected $className = SmileyEditor::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/data/smiley/category/SmileyCategoryAction.class.php b/wcfsetup/install/files/lib/data/smiley/category/SmileyCategoryAction.class.php index 5e0a5e88b7..2a442fd577 100644 --- a/wcfsetup/install/files/lib/data/smiley/category/SmileyCategoryAction.class.php +++ b/wcfsetup/install/files/lib/data/smiley/category/SmileyCategoryAction.class.php @@ -1,5 +1,6 @@ prepareStatement($sql); $statement2->execute(['wcf.style']); - $languageCategory = $statement2->fetchObject('wcf\data\language\category\LanguageCategory'); + $languageCategory = $statement2->fetchObject(LanguageCategory::class); } else { $languageCategory = LanguageFactory::getInstance()->getCategory('wcf.style'); diff --git a/wcfsetup/install/files/lib/data/style/variable/StyleVariableAction.class.php b/wcfsetup/install/files/lib/data/style/variable/StyleVariableAction.class.php index 005f5b01c0..f72361a3ff 100644 --- a/wcfsetup/install/files/lib/data/style/variable/StyleVariableAction.class.php +++ b/wcfsetup/install/files/lib/data/style/variable/StyleVariableAction.class.php @@ -16,5 +16,5 @@ class StyleVariableAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\style\variable\StyleVariableEditor'; + protected $className = StyleVariableEditor::class; } diff --git a/wcfsetup/install/files/lib/data/tag/TagAction.class.php b/wcfsetup/install/files/lib/data/tag/TagAction.class.php index 2f34bb17ad..e62954cf89 100644 --- a/wcfsetup/install/files/lib/data/tag/TagAction.class.php +++ b/wcfsetup/install/files/lib/data/tag/TagAction.class.php @@ -26,7 +26,7 @@ class TagAction extends AbstractDatabaseObjectAction implements ISearchAction { /** * @inheritDoc */ - protected $className = 'wcf\data\tag\TagEditor'; + protected $className = TagEditor::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/data/template/TemplateAction.class.php b/wcfsetup/install/files/lib/data/template/TemplateAction.class.php index 77910aff9e..e2c7a1bd21 100644 --- a/wcfsetup/install/files/lib/data/template/TemplateAction.class.php +++ b/wcfsetup/install/files/lib/data/template/TemplateAction.class.php @@ -17,7 +17,7 @@ class TemplateAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\template\TemplateEditor'; + protected $className = TemplateEditor::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/data/template/TemplateList.class.php b/wcfsetup/install/files/lib/data/template/TemplateList.class.php index e5ad95bbc4..7ffcb30073 100644 --- a/wcfsetup/install/files/lib/data/template/TemplateList.class.php +++ b/wcfsetup/install/files/lib/data/template/TemplateList.class.php @@ -18,7 +18,7 @@ class TemplateList extends DatabaseObjectList { /** * @inheritDoc */ - public $className = 'wcf\data\template\Template'; + public $className = Template::class; /** * Creates a new TemplateList object. diff --git a/wcfsetup/install/files/lib/data/template/group/TemplateGroupAction.class.php b/wcfsetup/install/files/lib/data/template/group/TemplateGroupAction.class.php index 7bccd08e0c..a1a31256d9 100644 --- a/wcfsetup/install/files/lib/data/template/group/TemplateGroupAction.class.php +++ b/wcfsetup/install/files/lib/data/template/group/TemplateGroupAction.class.php @@ -16,7 +16,7 @@ class TemplateGroupAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\template\group\TemplateGroupEditor'; + protected $className = TemplateGroupEditor::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/data/template/listener/TemplateListenerAction.class.php b/wcfsetup/install/files/lib/data/template/listener/TemplateListenerAction.class.php index 073d82a6b1..2ece26cb4b 100644 --- a/wcfsetup/install/files/lib/data/template/listener/TemplateListenerAction.class.php +++ b/wcfsetup/install/files/lib/data/template/listener/TemplateListenerAction.class.php @@ -16,5 +16,5 @@ class TemplateListenerAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\template\listener\TemplateListenerEditor'; + protected $className = TemplateListenerEditor::class; } diff --git a/wcfsetup/install/files/lib/data/user/follow/UserFollowingAction.class.php b/wcfsetup/install/files/lib/data/user/follow/UserFollowingAction.class.php index 0646cb3fb8..cb4fa4714e 100644 --- a/wcfsetup/install/files/lib/data/user/follow/UserFollowingAction.class.php +++ b/wcfsetup/install/files/lib/data/user/follow/UserFollowingAction.class.php @@ -19,7 +19,7 @@ class UserFollowingAction extends UserFollowAction { /** * @inheritDoc */ - protected $className = 'wcf\data\user\follow\UserFollowEditor'; + protected $className = UserFollowEditor::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/data/user/group/UserGroupAction.class.php b/wcfsetup/install/files/lib/data/user/group/UserGroupAction.class.php index 1da52ece5a..154576c727 100644 --- a/wcfsetup/install/files/lib/data/user/group/UserGroupAction.class.php +++ b/wcfsetup/install/files/lib/data/user/group/UserGroupAction.class.php @@ -21,7 +21,7 @@ class UserGroupAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - public $className = 'wcf\data\user\group\UserGroupEditor'; + public $className = UserGroupEditor::class; /** * editor object for the copied user group diff --git a/wcfsetup/install/files/lib/data/user/group/option/UserGroupOptionAction.class.php b/wcfsetup/install/files/lib/data/user/group/option/UserGroupOptionAction.class.php index 3e61654dd1..c729d0ad17 100644 --- a/wcfsetup/install/files/lib/data/user/group/option/UserGroupOptionAction.class.php +++ b/wcfsetup/install/files/lib/data/user/group/option/UserGroupOptionAction.class.php @@ -18,7 +18,7 @@ class UserGroupOptionAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\user\group\option\UserGroupOptionEditor'; + protected $className = UserGroupOptionEditor::class; /** * Updates option values for given option id. diff --git a/wcfsetup/install/files/lib/data/user/group/option/category/UserGroupOptionCategoryAction.class.php b/wcfsetup/install/files/lib/data/user/group/option/category/UserGroupOptionCategoryAction.class.php index 1349a37f7f..766c160c52 100644 --- a/wcfsetup/install/files/lib/data/user/group/option/category/UserGroupOptionCategoryAction.class.php +++ b/wcfsetup/install/files/lib/data/user/group/option/category/UserGroupOptionCategoryAction.class.php @@ -16,5 +16,5 @@ class UserGroupOptionCategoryAction extends AbstractDatabaseObjectAction { /** * @inheritDoc */ - protected $className = 'wcf\data\user\group\option\category\UserGroupOptionCategoryEditor'; + protected $className = UserGroupOptionCategoryEditor::class; } diff --git a/wcfsetup/install/files/lib/data/user/ignore/ViewableUserIgnoreList.class.php b/wcfsetup/install/files/lib/data/user/ignore/ViewableUserIgnoreList.class.php index 3d3f6d5af7..4959be4648 100644 --- a/wcfsetup/install/files/lib/data/user/ignore/ViewableUserIgnoreList.class.php +++ b/wcfsetup/install/files/lib/data/user/ignore/ViewableUserIgnoreList.class.php @@ -1,5 +1,7 @@ className, SingletonFactory::class)) { - throw new SystemException("'".$this->className."' does not extend 'wcf\system\SingletonFactory'"); + throw new SystemException("'".$this->className."' does not extend '".SingletonFactory::class."'"); } if (!is_subclass_of($this->className, IUserProfileMenuContent::class)) { - throw new SystemException("'".$this->className."' does not implement 'wcf\system\menu\user\profile\content\IUserProfileMenuContent'"); + throw new SystemException("'".$this->className."' does not implement '".IUserProfileMenuContent::class."'"); } $this->contentManager = call_user_func([$this->className, 'getInstance']); diff --git a/wcfsetup/install/files/lib/page/FollowingPage.class.php b/wcfsetup/install/files/lib/page/FollowingPage.class.php index d296064ff8..fe3796a3bc 100644 --- a/wcfsetup/install/files/lib/page/FollowingPage.class.php +++ b/wcfsetup/install/files/lib/page/FollowingPage.class.php @@ -1,5 +1,6 @@ objectListClassName, 'wcf\data\DatabaseObjectList')) { - throw new SystemException("'".$this->objectListClassName."' does not extend 'wcf\data\DatabaseObjectList'"); + if (!is_subclass_of($this->objectListClassName, DatabaseObjectList::class)) { + throw new SystemException("'".$this->objectListClassName."' does not extend '".DatabaseObjectList::class."'"); } $this->objectList = new $this->objectListClassName(); diff --git a/wcfsetup/install/files/lib/page/SearchResultPage.class.php b/wcfsetup/install/files/lib/page/SearchResultPage.class.php index 09c3799f1f..7c95ef4548 100644 --- a/wcfsetup/install/files/lib/page/SearchResultPage.class.php +++ b/wcfsetup/install/files/lib/page/SearchResultPage.class.php @@ -142,7 +142,7 @@ class SearchResultPage extends MultipleLinkPage { $objectType = SearchEngine::getInstance()->getObjectType($type); if (($message = $objectType->getObject($objectID)) !== null) { if (!($message instanceof ISearchResultObject)) { - throw new SystemException("'".get_class($message)."' does not implement 'wcf\data\search\ISearchResultObject'"); + throw new SystemException("'".get_class($message)."' does not implement '".ISearchResultObject::class."'"); } $this->messages[] = $message; diff --git a/wcfsetup/install/files/lib/system/CLIWCF.class.php b/wcfsetup/install/files/lib/system/CLIWCF.class.php index 1aa7cee0e3..ee6d601a2a 100644 --- a/wcfsetup/install/files/lib/system/CLIWCF.class.php +++ b/wcfsetup/install/files/lib/system/CLIWCF.class.php @@ -22,7 +22,7 @@ use Zend\Console\Getopt as ArgvParser; use Zend\Loader\StandardAutoloader as ZendLoader; // set exception handler -set_exception_handler(['wcf\system\CLIWCF', 'handleCLIException']); +set_exception_handler([CLIWCF::class, 'handleCLIException']); /** * Extends WCF class with functions for CLI. @@ -83,7 +83,7 @@ class CLIWCF extends WCF { $this->initApplications(); // the destructor registered in core.functions.php will only call the destructor of the parent class - register_shutdown_function(['wcf\system\CLIWCF', 'destruct']); + register_shutdown_function([self::class, 'destruct']); $this->initArgv(); $this->initPHPLine(); diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index 6323ab85f9..2fc6c4dceb 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -14,6 +14,7 @@ use wcf\system\box\BoxHandler; use wcf\system\cache\builder\CoreObjectCacheBuilder; use wcf\system\cache\builder\PackageUpdateCacheBuilder; use wcf\system\cronjob\CronjobScheduler; +use wcf\system\database\MySQLDatabase; use wcf\system\event\EventHandler; use wcf\system\exception\AJAXException; use wcf\system\exception\ErrorException; @@ -299,7 +300,7 @@ class WCF { // get configuration $dbHost = $dbUser = $dbPassword = $dbName = ''; $dbPort = 0; - $dbClass = 'wcf\system\database\MySQLDatabase'; + $dbClass = MySQLDatabase::class; require(WCF_DIR.'config.inc.php'); // create database connection @@ -528,7 +529,7 @@ class WCF { self::$autoloadDirectories[$abbreviation] = $packageDir . 'lib/'; $className = $abbreviation.'\system\\'.strtoupper($abbreviation).'Core'; - if (class_exists($className) && is_subclass_of($className, 'wcf\system\application\IApplication')) { + if (class_exists($className) && is_subclass_of($className, IApplication::class)) { // include config file $configPath = $packageDir . PackageInstallationDispatcher::CONFIG_FILE; @@ -556,7 +557,7 @@ class WCF { } else { unset(self::$autoloadDirectories[$abbreviation]); - throw new SystemException("Unable to run '".$package->package."', '".$className."' is missing or does not implement 'wcf\system\application\IApplication'."); + throw new SystemException("Unable to run '".$package->package."', '".$className."' is missing or does not implement '".IApplication::class."'."); } // register template path in ACP @@ -719,8 +720,8 @@ class WCF { } if (class_exists($objectName)) { - if (!(is_subclass_of($objectName, 'wcf\system\SingletonFactory'))) { - throw new SystemException("class '".$objectName."' does not implement the interface 'SingletonFactory'"); + if (!(is_subclass_of($objectName, SingletonFactory::class))) { + throw new SystemException("class '".$objectName."' does not implement the interface '".SingletonFactory::class."'"); } self::$coreObject[$className] = call_user_func([$objectName, 'getInstance']); diff --git a/wcfsetup/install/files/lib/system/WCFSetup.class.php b/wcfsetup/install/files/lib/system/WCFSetup.class.php index a9950efbc2..6ac9a25fbe 100644 --- a/wcfsetup/install/files/lib/system/WCFSetup.class.php +++ b/wcfsetup/install/files/lib/system/WCFSetup.class.php @@ -8,6 +8,7 @@ use wcf\data\user\User; use wcf\data\user\UserAction; use wcf\system\cache\builder\LanguageCacheBuilder; use wcf\system\database\util\SQLParser; +use wcf\system\database\MySQLDatabase; use wcf\system\exception\SystemException; use wcf\system\exception\UserInputException; use wcf\system\io\File; @@ -93,7 +94,7 @@ class WCFSetup extends WCF { * @var string[][] */ protected static $dbClasses = [ - 'MySQLDatabase' => ['class' => 'wcf\system\database\MySQLDatabase', 'minversion' => '5.1.17']//, // MySQL 5.1.17+ + 'MySQLDatabase' => ['class' => MySQLDatabase::class, 'minversion' => '5.1.17']//, // MySQL 5.1.17+ //'PostgreSQLDatabase' => ['class' => 'wcf\system\database\PostgreSQLDatabase', 'minversion' => '8.2.0'] // PostgreSQL 8.2.0+ ]; @@ -709,7 +710,7 @@ class WCFSetup extends WCF { } } // check innodb support - if ($dbClass == 'wcf\system\database\MySQLDatabase') { + if ($dbClass == MySQLDatabase::class) { $sql = "SHOW ENGINES"; $statement = $db->prepareStatement($sql); $statement->execute(); diff --git a/wcfsetup/install/files/lib/system/application/AbstractApplication.class.php b/wcfsetup/install/files/lib/system/application/AbstractApplication.class.php index 115ed87dcb..7559bae07f 100644 --- a/wcfsetup/install/files/lib/system/application/AbstractApplication.class.php +++ b/wcfsetup/install/files/lib/system/application/AbstractApplication.class.php @@ -3,6 +3,7 @@ namespace wcf\system\application; use wcf\data\package\PackageCache; use wcf\system\exception\SystemException; use wcf\system\SingletonFactory; +use wcf\system\WCF; /** * Abstract implementation of a community framework application. @@ -98,6 +99,6 @@ abstract class AbstractApplication extends SingletonFactory implements IApplicat * @inheritDoc */ public static function __callStatic($method, array $arguments) { - return call_user_func_array(['wcf\system\WCF', $method], $arguments); + return call_user_func_array([WCF::class, $method], $arguments); } } diff --git a/wcfsetup/install/files/lib/system/background/BackgroundQueueHandler.class.php b/wcfsetup/install/files/lib/system/background/BackgroundQueueHandler.class.php index bf3d31c75f..2f417ceb5c 100644 --- a/wcfsetup/install/files/lib/system/background/BackgroundQueueHandler.class.php +++ b/wcfsetup/install/files/lib/system/background/BackgroundQueueHandler.class.php @@ -57,7 +57,7 @@ class BackgroundQueueHandler extends SingletonFactory { if (!is_array($jobs)) $jobs = [$jobs]; foreach ($jobs as $job) { if (!($job instanceof AbstractBackgroundJob)) { - throw new SystemException('$jobs contains an item that does not extend \wcf\system\background\job\AbstractBackgroundJob.'); + throw new SystemException('$jobs contains an item that does not extend \''.AbstractBackgroundJob::class.'\'.'); } } diff --git a/wcfsetup/install/files/lib/system/bbcode/CodeBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/CodeBBCode.class.php index 024c474a9c..a6c15eaa40 100644 --- a/wcfsetup/install/files/lib/system/bbcode/CodeBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/CodeBBCode.class.php @@ -1,5 +1,19 @@ mapAttributes($openingTag); // fetch highlighter-classname - $className = '\wcf\system\bbcode\highlighter\PlainHighlighter'; + $className = PlainHighlighter::class; // no highlighting for strings over a certain size, to prevent DoS // this serves as a safety net in case one of the regular expressions @@ -61,70 +75,70 @@ class CodeBBCode extends AbstractBBCode { switch (mb_substr($className, strlen('\wcf\system\bbcode\highlighter\\'))) { case 'ShellHighlighter': - $className = '\wcf\system\bbcode\highlighter\BashHighlighter'; + $className = BashHighlighter::class; break; case 'C++Highlighter': - $className = '\wcf\system\bbcode\highlighter\CHighlighter'; + $className = CHighlighter::class; break; case 'JavascriptHighlighter': - $className = '\wcf\system\bbcode\highlighter\JsHighlighter'; + $className = JsHighlighter::class; break; case 'LatexHighlighter': - $className = '\wcf\system\bbcode\highlighter\TexHighlighter'; + $className = TexHighlighter::class; break; } } else { // try to guess highlighter if (mb_strpos($content, 'match($content)) { - $className = '\wcf\system\bbcode\highlighter\BashHighlighter'; + $className = BashHighlighter::class; } else if (mb_strpos($content, '\\documentclass') !== false) { - $className = '\wcf\system\bbcode\highlighter\TexHighlighter'; + $className = TexHighlighter::class; } else if (Regex::compile('[-\\+\\.,\\[\\]\\>\\<]{9}')->match($content)) { // 9 times a brainfuck char in a row -> seems to be brainfuck - $className = '\wcf\system\bbcode\highlighter\BrainfuckHighlighter'; + $className = BrainfuckHighlighter::class; } } } if (!class_exists($className)) { - $className = '\wcf\system\bbcode\highlighter\PlainHighlighter'; + $className = PlainHighlighter::class; } if ($parser->getOutputType() == 'text/html') { diff --git a/wcfsetup/install/files/lib/system/cache/builder/ACPMenuCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/ACPMenuCacheBuilder.class.php index e910f512ed..d4fd5b5745 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/ACPMenuCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/ACPMenuCacheBuilder.class.php @@ -1,5 +1,6 @@ 'wcf.acp.option.category.'.$optionCategory->categoryName, 'parentMenuItem' => 'wcf.acp.menu.link.option.category', - 'menuItemController' => 'wcf\acp\form\OptionForm', + 'menuItemController' => OptionForm::class, 'permissions' => $optionCategory->permissions, 'optionCategoryID' => $optionCategory->categoryID, 'options' => $optionCategory->options diff --git a/wcfsetup/install/files/lib/system/cache/builder/EventListenerCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/EventListenerCacheBuilder.class.php index 29119e7579..c7acb9adb7 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/EventListenerCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/EventListenerCacheBuilder.class.php @@ -1,5 +1,6 @@ prepareStatement($sql); $statement->execute(); - while ($eventListener = $statement->fetchObject('wcf\data\event\listener\EventListener')) { + while ($eventListener = $statement->fetchObject(EventListener::class)) { $eventNames = $eventListener->getEventNames(); if (!$eventListener->inherit) { diff --git a/wcfsetup/install/files/lib/system/cache/builder/OptionCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/OptionCacheBuilder.class.php index afb0a32bcb..920dd82dc5 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/OptionCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/OptionCacheBuilder.class.php @@ -1,6 +1,7 @@ prepareStatement($sql); $statement->execute(); - while ($object = $statement->fetchObject('wcf\data\smiley\Smiley')) { + while ($object = $statement->fetchObject(Smiley::class)) { $object->smileyCodes = $object->getAliases(); $object->smileyCodes[] = $object->smileyCode; diff --git a/wcfsetup/install/files/lib/system/cache/builder/UserGroupOptionCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/UserGroupOptionCacheBuilder.class.php index 01ce3059ab..95741fbb08 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/UserGroupOptionCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/UserGroupOptionCacheBuilder.class.php @@ -1,5 +1,6 @@ $row['packageID'], 'menuItem' => 'wcf.user.option.category.'.$row['categoryName'], 'parentMenuItem' => 'wcf.user.menu.settings', - 'menuItemController' => 'wcf\form\SettingsForm', + 'menuItemController' => SettingsForm::class, 'menuItemLink' => ($categoryShortName != 'general' ? 'category='.$categoryShortName : ''), 'permissions' => $row['permissions'], 'options' => $row['options'] diff --git a/wcfsetup/install/files/lib/system/cache/builder/UserOptionCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/UserOptionCacheBuilder.class.php index 25f2ab0fa8..6ca556a367 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/UserOptionCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/UserOptionCacheBuilder.class.php @@ -1,5 +1,6 @@ prepareStatement($sql, 1); $statement->execute(); - $data['newestMember'] = $statement->fetchObject('wcf\data\user\User'); + $data['newestMember'] = $statement->fetchObject(User::class); return $data; } diff --git a/wcfsetup/install/files/lib/system/cli/command/WorkerCLICommand.class.php b/wcfsetup/install/files/lib/system/cli/command/WorkerCLICommand.class.php index 4ca2181a0c..42ca44c8d7 100644 --- a/wcfsetup/install/files/lib/system/cli/command/WorkerCLICommand.class.php +++ b/wcfsetup/install/files/lib/system/cli/command/WorkerCLICommand.class.php @@ -1,6 +1,7 @@ isInstantiable()) { $invalid = true; } - else if (!is_subclass_of($class, 'wcf\system\worker\IWorker')) { + else if (!is_subclass_of($class, IWorker::class)) { $invalid = true; } } @@ -155,7 +156,7 @@ class WorkerCLICommand implements IArgumentedCLICommand { $reflection = new \ReflectionClass($class); if (!$reflection->isInstantiable()) continue; - if (!is_subclass_of($class, 'wcf\system\worker\IWorker')) { + if (!is_subclass_of($class, IWorker::class)) { Log::info('Invalid worker file: ', $worker); continue; } diff --git a/wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php b/wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php index 28c6f80c64..c37b9b4fb4 100644 --- a/wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php +++ b/wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php @@ -4,6 +4,7 @@ use wcf\data\object\type\ObjectTypeCache; use wcf\data\DatabaseObject; use wcf\system\cache\builder\ClipboardActionCacheBuilder; use wcf\system\cache\builder\ClipboardPageCacheBuilder; +use wcf\system\clipboard\action\IClipboardAction; use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\exception\SystemException; use wcf\system\SingletonFactory; @@ -323,8 +324,8 @@ class ClipboardHandler extends SingletonFactory { $actionClassName = $actionObject->actionClassName; if (!isset($actions[$actionClassName])) { // validate class - if (!is_subclass_of($actionClassName, 'wcf\system\clipboard\action\IClipboardAction')) { - throw new SystemException("'".$actionClassName."' does not implement 'wcf\system\clipboard\action\IClipboardAction'"); + if (!is_subclass_of($actionClassName, IClipboardAction::class)) { + throw new SystemException("'".$actionClassName."' does not implement '".IClipboardAction::class."'"); } $actions[$actionClassName] = [ diff --git a/wcfsetup/install/files/lib/system/clipboard/action/TagClipboardAction.class.php b/wcfsetup/install/files/lib/system/clipboard/action/TagClipboardAction.class.php index 2490a97ff7..4be20cbe21 100644 --- a/wcfsetup/install/files/lib/system/clipboard/action/TagClipboardAction.class.php +++ b/wcfsetup/install/files/lib/system/clipboard/action/TagClipboardAction.class.php @@ -1,6 +1,7 @@ listenerClassName)) { throw new SystemException("Unable to find class '".$eventListener->listenerClassName."'"); } - if (!is_subclass_of($eventListener->listenerClassName, 'wcf\system\event\listener\IParameterizedEventListener')) { + if (!is_subclass_of($eventListener->listenerClassName, IParameterizedEventListener::class)) { // legacy event listeners - if (!is_subclass_of($eventListener->listenerClassName, 'wcf\system\event\IEventListener')) { - throw new SystemException("'".$eventListener->listenerClassName."' does not implement 'wcf\system\event\listener\IParameterizedEventListener'"); + if (!is_subclass_of($eventListener->listenerClassName, IEventListener::class)) { + throw new SystemException("'".$eventListener->listenerClassName."' does not implement '".IParameterizedEventListener::class."'"); } } @@ -200,10 +200,10 @@ class EventHandler extends SingletonFactory { if (!class_exists($eventListener->listenerClassName)) { throw new SystemException("Unable to find class '".$eventListener->listenerClassName."'"); } - if (!is_subclass_of($eventListener->listenerClassName, 'wcf\system\event\listener\IParameterizedEventListener')) { + if (!is_subclass_of($eventListener->listenerClassName, IParameterizedEventListener::class)) { // legacy event listeners - if (!is_subclass_of($eventListener->listenerClassName, 'wcf\system\event\IEventListener')) { - throw new SystemException("'".$eventListener->listenerClassName."' does not implement 'wcf\system\event\listener\IParameterizedEventListener'"); + if (!is_subclass_of($eventListener->listenerClassName, IEventListener::class)) { + throw new SystemException("'".$eventListener->listenerClassName."' does not implement '".IParameterizedEventListener::class."'"); } } diff --git a/wcfsetup/install/files/lib/system/form/element/MultipleSelectionFormElement.class.php b/wcfsetup/install/files/lib/system/form/element/MultipleSelectionFormElement.class.php index a08c471567..1d3f75ecc9 100644 --- a/wcfsetup/install/files/lib/system/form/element/MultipleSelectionFormElement.class.php +++ b/wcfsetup/install/files/lib/system/form/element/MultipleSelectionFormElement.class.php @@ -1,5 +1,6 @@ value = array_map(['wcf\util\StringUtil', 'trim'], $value); + $this->value = array_map([StringUtil::class, 'trim'], $value); } } diff --git a/wcfsetup/install/files/lib/system/image/ImageHandler.class.php b/wcfsetup/install/files/lib/system/image/ImageHandler.class.php index 92fcea92fa..186be4cca4 100644 --- a/wcfsetup/install/files/lib/system/image/ImageHandler.class.php +++ b/wcfsetup/install/files/lib/system/image/ImageHandler.class.php @@ -1,7 +1,9 @@ 'wcf\system\image\adapter\GDImageAdapter', - 'imagick' => 'wcf\system\image\adapter\ImagickImageAdapter' + 'gd' => GDImageAdapter::class, + 'imagick' => ImagickImageAdapter::class ]; /** diff --git a/wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php index e6adc260e2..61701ee535 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php @@ -18,7 +18,7 @@ class AbstractAttachmentImporter extends AbstractImporter { /** * @inheritDoc */ - protected $className = 'wcf\data\attachment\Attachment'; + protected $className = Attachment::class; /** * object type id for attachments diff --git a/wcfsetup/install/files/lib/system/importer/AbstractCategoryImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractCategoryImporter.class.php index eaca3b785d..b748d63132 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractCategoryImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractCategoryImporter.class.php @@ -1,5 +1,6 @@ labelGroups['groups'][$groupID]; } - uasort($data, ['\wcf\data\label\group\LabelGroup', 'sortLabelGroups']); + uasort($data, [LabelGroup::class, 'sortLabelGroups']); return $data; } diff --git a/wcfsetup/install/files/lib/system/label/object/AbstractLabelObjectHandler.class.php b/wcfsetup/install/files/lib/system/label/object/AbstractLabelObjectHandler.class.php index 42c53308b2..2427575760 100644 --- a/wcfsetup/install/files/lib/system/label/object/AbstractLabelObjectHandler.class.php +++ b/wcfsetup/install/files/lib/system/label/object/AbstractLabelObjectHandler.class.php @@ -1,5 +1,6 @@ labelGroups[$groupID]; } - uasort($data, ['\wcf\data\label\group\LabelGroup', 'sortLabelGroups']); + uasort($data, [LabelGroup::class, 'sortLabelGroups']); return $data; } diff --git a/wcfsetup/install/files/lib/system/message/QuickReplyManager.class.php b/wcfsetup/install/files/lib/system/message/QuickReplyManager.class.php index b775bbc0da..4977567595 100644 --- a/wcfsetup/install/files/lib/system/message/QuickReplyManager.class.php +++ b/wcfsetup/install/files/lib/system/message/QuickReplyManager.class.php @@ -4,6 +4,7 @@ use wcf\data\DatabaseObjectDecorator; use wcf\data\IAttachmentMessageQuickReplyAction; use wcf\data\IMessage; use wcf\data\IMessageQuickReplyAction; +use wcf\data\IVisitableObjectAction; use wcf\system\bbcode\PreParser; use wcf\system\event\EventHandler; use wcf\system\exception\SystemException; @@ -135,8 +136,8 @@ class QuickReplyManager extends SingletonFactory { $this->container = new $containerClassName($parameters['objectID']); if (!empty($containerDecoratorClassName)) { - if (!is_subclass_of($containerDecoratorClassName, 'wcf\data\DatabaseObjectDecorator')) { - throw new SystemException("'".$containerDecoratorClassName."' does not extend 'wcf\data\DatabaseObjectDecorator'"); + if (!is_subclass_of($containerDecoratorClassName, DatabaseObjectDecorator::class)) { + throw new SystemException("'".$containerDecoratorClassName."' does not extend '".DatabaseObjectDecorator::class."'"); } $this->container = new $containerDecoratorClassName($this->container); @@ -234,7 +235,7 @@ class QuickReplyManager extends SingletonFactory { } // update visit time (messages shouldn't occur as new upon next visit) - if (is_subclass_of($containerActionClassName, 'wcf\data\IVisitableObjectAction')) { + if (is_subclass_of($containerActionClassName, IVisitableObjectAction::class)) { $containerAction = new $containerActionClassName([($this->container instanceof DatabaseObjectDecorator ? $this->container->getDecoratedObject() : $this->container)], 'markAsRead'); $containerAction->executeAction(); } diff --git a/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueHandler.class.php b/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueHandler.class.php index ebeee96193..a664f54bb4 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueHandler.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueHandler.class.php @@ -4,6 +4,7 @@ use wcf\data\moderation\queue\ModerationQueue; use wcf\data\moderation\queue\ModerationQueueAction; use wcf\data\user\User; use wcf\data\user\UserProfile; +use wcf\data\DatabaseObject; use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\exception\SystemException; use wcf\system\moderation\queue\activation\IModerationQueueActivationHandler; @@ -49,7 +50,7 @@ abstract class AbstractModerationQueueHandler implements IModerationQueueHandler * @inheritDoc */ public function identifyOrphans(array $queues) { - if (empty($this->className) || !class_exists($this->className) || !is_subclass_of($this->className, 'wcf\data\DatabaseObject')) { + if (empty($this->className) || !class_exists($this->className) || !is_subclass_of($this->className, DatabaseObject::class)) { throw new SystemException("DatabaseObject class name '" . $this->className . "' is missing or invalid"); } diff --git a/wcfsetup/install/files/lib/system/option/AbstractCategoryMultiSelectOptionType.class.php b/wcfsetup/install/files/lib/system/option/AbstractCategoryMultiSelectOptionType.class.php index ec936b496a..12358c0138 100644 --- a/wcfsetup/install/files/lib/system/option/AbstractCategoryMultiSelectOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/AbstractCategoryMultiSelectOptionType.class.php @@ -1,5 +1,6 @@ filevalidation) { $fileValidation = new $option->filevalidation(); if (!($fileValidation instanceof IUploadFileValidationStrategy)) { - throw new SystemException("The file validation class needs to implement 'wcf\system\upload\IUploadFileValidationStrategy'"); + throw new SystemException("The file validation class needs to implement '".IUploadFileValidationStrategy::class."'"); } if (!$this->uploadHandlers[$option->optionName]->validateFiles($fileValidation)) { diff --git a/wcfsetup/install/files/lib/system/option/OptionHandler.class.php b/wcfsetup/install/files/lib/system/option/OptionHandler.class.php index e9b7f736b1..16a98ffb31 100644 --- a/wcfsetup/install/files/lib/system/option/OptionHandler.class.php +++ b/wcfsetup/install/files/lib/system/option/OptionHandler.class.php @@ -3,6 +3,7 @@ namespace wcf\system\option; use wcf\data\option\category\OptionCategory; use wcf\data\option\Option; use wcf\system\application\ApplicationHandler; +use wcf\system\cache\builder\OptionCacheBuilder; use wcf\system\event\EventHandler; use wcf\system\exception\SystemException; use wcf\system\exception\UserInputException; @@ -30,7 +31,7 @@ class OptionHandler implements IOptionHandler { * cache class name * @var string */ - protected $cacheClass = 'wcf\system\cache\builder\OptionCacheBuilder'; + protected $cacheClass = OptionCacheBuilder::class; /** * list of all option categories @@ -378,8 +379,8 @@ class OptionHandler implements IOptionHandler { return null; } - if (!is_subclass_of($className, 'wcf\system\option\IOptionType')) { - throw new SystemException("'".$className."' does not implement 'wcf\system\option\IOptionType'"); + if (!is_subclass_of($className, IOptionType::class)) { + throw new SystemException("'".$className."' does not implement '".IOptionType::class."'"); } return $className; diff --git a/wcfsetup/install/files/lib/system/option/user/UserOptionHandler.class.php b/wcfsetup/install/files/lib/system/option/user/UserOptionHandler.class.php index 08ea43cca9..141e9827c3 100644 --- a/wcfsetup/install/files/lib/system/option/user/UserOptionHandler.class.php +++ b/wcfsetup/install/files/lib/system/option/user/UserOptionHandler.class.php @@ -5,6 +5,7 @@ use wcf\data\option\Option; use wcf\data\user\option\UserOption; use wcf\data\user\option\ViewableUserOption; use wcf\data\user\User; +use wcf\system\cache\builder\UserOptionCacheBuilder; use wcf\system\exception\UserInputException; use wcf\system\option\ISearchableConditionUserOption; use wcf\system\option\OptionHandler; @@ -25,7 +26,7 @@ class UserOptionHandler extends OptionHandler { /** * @inheritDoc */ - protected $cacheClass = 'wcf\system\cache\builder\UserOptionCacheBuilder'; + protected $cacheClass = UserOptionCacheBuilder::class; /** * true if within registration process diff --git a/wcfsetup/install/files/lib/system/option/user/group/UserGroupOptionHandler.class.php b/wcfsetup/install/files/lib/system/option/user/group/UserGroupOptionHandler.class.php index 6afdf61fc6..5625f60f7a 100644 --- a/wcfsetup/install/files/lib/system/option/user/group/UserGroupOptionHandler.class.php +++ b/wcfsetup/install/files/lib/system/option/user/group/UserGroupOptionHandler.class.php @@ -2,6 +2,7 @@ namespace wcf\system\option\user\group; use wcf\data\option\Option; use wcf\data\user\group\UserGroup; +use wcf\system\cache\builder\UserGroupOptionCacheBuilder; use wcf\system\exception\SystemException; use wcf\system\exception\UserInputException; use wcf\system\option\OptionHandler; @@ -21,7 +22,7 @@ class UserGroupOptionHandler extends OptionHandler { /** * @inheritDoc */ - protected $cacheClass = 'wcf\system\cache\builder\UserGroupOptionCacheBuilder'; + protected $cacheClass = UserGroupOptionCacheBuilder::class; /** * user group object @@ -83,8 +84,8 @@ class UserGroupOptionHandler extends OptionHandler { if (!class_exists($className)) { return null; } - if (!is_subclass_of($className, 'wcf\system\option\user\group\IUserGroupOptionType')) { - throw new SystemException("'".$className."' does not implement 'wcf\system\option\user\group\IUserGroupOptionType'"); + if (!is_subclass_of($className, IUserGroupOptionType::class)) { + throw new SystemException("'".$className."' does not implement '".IUserGroupOptionType::class."'"); } return $className; diff --git a/wcfsetup/install/files/lib/system/package/PackageArchive.class.php b/wcfsetup/install/files/lib/system/package/PackageArchive.class.php index 4ccd9547e5..9c40bb5157 100644 --- a/wcfsetup/install/files/lib/system/package/PackageArchive.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageArchive.class.php @@ -679,7 +679,7 @@ class PackageArchive { // sort multiple packages by version number foreach ($existingPackages as $packageName => $instances) { - uksort($instances, ['wcf\data\package\Package', 'compareVersion']); + uksort($instances, [Package::class, 'compareVersion']); // get package with highest version number (get last package) $existingPackages[$packageName] = array_pop($instances); diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php index 751a3beba1..b875a77500 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php @@ -463,7 +463,7 @@ class PackageInstallationDispatcher { WHERE languageCategory = ?"; $statement2 = WCF::getDB()->prepareStatement($sql); $statement2->execute(['wcf.acp.package']); - $languageCategory = $statement2->fetchObject('wcf\data\language\category\LanguageCategory'); + $languageCategory = $statement2->fetchObject(LanguageCategory::class); } else { $languageCategory = LanguageFactory::getInstance()->getCategory('wcf.acp.package'); @@ -570,7 +570,7 @@ class PackageInstallationDispatcher { $plugin = new $className($this, $nodeData); if (!($plugin instanceof IPackageInstallationPlugin)) { - throw new SystemException("'".$className."' does not implement 'wcf\\system\\package\\plugin\\IPackageInstallationPlugin'"); + throw new SystemException("'".$className."' does not implement '".IPackageInstallationPlugin::class."'"); } // execute PIP diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php index 7e638699f1..91212ae5f7 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php @@ -184,7 +184,7 @@ class PackageInstallationScheduler { if (isset($installedPackages[$row['package']])) { // package already installed -> check version // sort multiple instances by version number - uasort($installedPackages[$row['package']], ['wcf\data\package\Package', 'compareVersion']); + uasort($installedPackages[$row['package']], [Package::class, 'compareVersion']); foreach ($installedPackages[$row['package']] as $packageID => $packageVersion) { if (empty($row['minversion']) || Package::compareVersion($row['minversion'], $packageVersion, '<=')) { @@ -481,7 +481,7 @@ class PackageInstallationScheduler { if (count($packageVersions) > 1) { // sort by version number - usort($packageVersions, ['wcf\data\package\Package', 'compareVersion']); + usort($packageVersions, [Package::class, 'compareVersion']); // get highest version $version = array_pop($packageVersions); @@ -511,7 +511,7 @@ class PackageInstallationScheduler { } // sort by version number - uksort($fromversions, ['wcf\data\package\Package', 'compareVersion']); + uksort($fromversions, [Package::class, 'compareVersion']); // find shortest update thread $updateThread = $this->findShortestUpdateThread($package->package, $fromversions, $packageVersion, $version); diff --git a/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php index 36c99d60aa..6c3a478807 100644 --- a/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php @@ -722,7 +722,7 @@ class PackageUpdateDispatcher extends SingletonFactory { } // sort by version number - usort($versions, ['wcf\data\package\Package', 'compareVersion']); + usort($versions, [Package::class, 'compareVersion']); // take newest (last) return array_pop($versions); diff --git a/wcfsetup/install/files/lib/system/package/plugin/ACLOptionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ACLOptionPackageInstallationPlugin.class.php index e43139b873..2346a8b556 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ACLOptionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ACLOptionPackageInstallationPlugin.class.php @@ -1,5 +1,6 @@ prepareStatement($sql); $statement->execute([$requirement['name']]); - $package = $statement->fetchObject('wcf\data\package\Package'); + $package = $statement->fetchObject(Package::class); throw new PackageValidationException(PackageValidationException::MISSING_REQUIREMENT, [ 'package' => $package, diff --git a/wcfsetup/install/files/lib/system/poll/PollManager.class.php b/wcfsetup/install/files/lib/system/poll/PollManager.class.php index 72d1a19569..8f2baaeb98 100644 --- a/wcfsetup/install/files/lib/system/poll/PollManager.class.php +++ b/wcfsetup/install/files/lib/system/poll/PollManager.class.php @@ -421,11 +421,11 @@ class PollManager extends SingletonFactory { // validates against object type's class $className = $this->cache[$objectType]->className; - if (!is_subclass_of($className, 'wcf\system\poll\IPollHandler')) { - throw new SystemException("'".$className."' does not implement 'wcf\system\poll\IPollHandler'"); + if (!is_subclass_of($className, IPollHandler::class)) { + throw new SystemException("'".$className."' does not implement '".IPollHandler::class."'"); } - else if (!is_subclass_of($className, 'wcf\system\SingletonFactory')) { - throw new SystemException("'".$className."' does not extend 'wcf\system\SingletonFactory'"); + else if (!is_subclass_of($className, SingletonFactory::class)) { + throw new SystemException("'".$className."' does not extend '".SingletonFactory::class."'"); } $object = call_user_func([$className, 'getInstance']); diff --git a/wcfsetup/install/files/lib/system/search/SearchEngine.class.php b/wcfsetup/install/files/lib/system/search/SearchEngine.class.php index 5e7c2116c3..e36fcfa215 100644 --- a/wcfsetup/install/files/lib/system/search/SearchEngine.class.php +++ b/wcfsetup/install/files/lib/system/search/SearchEngine.class.php @@ -3,6 +3,7 @@ namespace wcf\system\search; use wcf\data\object\type\ObjectTypeCache; use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\exception\SystemException; +use wcf\system\search\mysql\MysqlSearchEngine; use wcf\system\SingletonFactory; /** @@ -84,12 +85,12 @@ class SearchEngine extends SingletonFactory implements ISearchEngine { $className = ''; } } - + // fallback to MySQL if (empty($className)) { - $className = 'wcf\system\search\mysql\MysqlSearchEngine'; + $className = MysqlSearchEngine::class; } - + $this->searchEngine = call_user_func([$className, 'getInstance']); } diff --git a/wcfsetup/install/files/lib/system/search/SearchIndexManager.class.php b/wcfsetup/install/files/lib/system/search/SearchIndexManager.class.php index 5e1299b820..15706a9c4f 100644 --- a/wcfsetup/install/files/lib/system/search/SearchIndexManager.class.php +++ b/wcfsetup/install/files/lib/system/search/SearchIndexManager.class.php @@ -5,6 +5,7 @@ use wcf\data\object\type\ObjectTypeCache; use wcf\data\package\Package; use wcf\data\package\PackageList; use wcf\system\exception\SystemException; +use wcf\system\search\mysql\MysqlSearchIndexManager; use wcf\system\SingletonFactory; /** @@ -91,7 +92,7 @@ class SearchIndexManager extends SingletonFactory implements ISearchIndexManager // fallback to MySQL if (empty($className)) { - $className = 'wcf\system\search\mysql\MysqlSearchIndexManager'; + $className = MysqlSearchIndexManager::class; } $this->searchIndexManager = call_user_func([$className, 'getInstance']); diff --git a/wcfsetup/install/files/lib/system/search/SearchKeywordManager.class.php b/wcfsetup/install/files/lib/system/search/SearchKeywordManager.class.php index d1670d0ee2..231d073980 100644 --- a/wcfsetup/install/files/lib/system/search/SearchKeywordManager.class.php +++ b/wcfsetup/install/files/lib/system/search/SearchKeywordManager.class.php @@ -1,5 +1,6 @@ prepareStatement($sql); $statement->execute([$keyword]); - if (($object = $statement->fetchObject('wcf\data\search\keyword\SearchKeyword')) !== null) { + if (($object = $statement->fetchObject(SearchKeyword::class)) !== null) { $action = new SearchKeywordAction([$object], 'update', ['data' => [ 'searches' => $object->searches + 1, 'lastSearchTime' => TIME_NOW diff --git a/wcfsetup/install/files/lib/system/search/acp/ACPSearchHandler.class.php b/wcfsetup/install/files/lib/system/search/acp/ACPSearchHandler.class.php index a3e0941441..51f97868e1 100644 --- a/wcfsetup/install/files/lib/system/search/acp/ACPSearchHandler.class.php +++ b/wcfsetup/install/files/lib/system/search/acp/ACPSearchHandler.class.php @@ -51,8 +51,8 @@ class ACPSearchHandler extends SingletonFactory { foreach ($this->cache as $acpSearchProvider) { $className = $acpSearchProvider->className; - if (!is_subclass_of($className, 'wcf\system\search\acp\IACPSearchResultProvider')) { - throw new SystemException("'".$className."' does not implement 'wcf\system\search\acp\IACPSearchResultProvider'"); + if (!is_subclass_of($className, IACPSearchResultProvider::class)) { + throw new SystemException("'".$className."' does not implement '".IACPSearchResultProvider::class."'"); } $provider = new $className(); diff --git a/wcfsetup/install/files/lib/system/search/acp/AbstractCategorizedACPSearchResultProvider.class.php b/wcfsetup/install/files/lib/system/search/acp/AbstractCategorizedACPSearchResultProvider.class.php index b5f2c8616f..bec4cad3b9 100644 --- a/wcfsetup/install/files/lib/system/search/acp/AbstractCategorizedACPSearchResultProvider.class.php +++ b/wcfsetup/install/files/lib/system/search/acp/AbstractCategorizedACPSearchResultProvider.class.php @@ -1,6 +1,7 @@ listClassName) || !is_subclass_of($this->listClassName, 'wcf\data\DatabaseObjectList')) { + if (empty($this->listClassName) || !is_subclass_of($this->listClassName, DatabaseObjectList::class)) { throw new SystemException("Given class '".$this->listClassName."' is empty or invalid"); } diff --git a/wcfsetup/install/files/lib/system/search/acp/MenuItemACPSearchResultProvider.class.php b/wcfsetup/install/files/lib/system/search/acp/MenuItemACPSearchResultProvider.class.php index 93177e813a..8e26b833b7 100644 --- a/wcfsetup/install/files/lib/system/search/acp/MenuItemACPSearchResultProvider.class.php +++ b/wcfsetup/install/files/lib/system/search/acp/MenuItemACPSearchResultProvider.class.php @@ -1,5 +1,6 @@ execute($conditions->getParameters()); $menuItems = ACPMenu::getInstance()->menuItemList; - while ($menuItem = $statement->fetchObject('wcf\data\acp\menu\item\ACPMenuItem')) { + while ($menuItem = $statement->fetchObject(ACPMenuItem::class)) { // only valid menu items exist in TreeMenu::$menuItemList, // so no need to call AbstractACPSearchResultProvider::validate() if (!isset($menuItems[$menuItem->menuItem])) { diff --git a/wcfsetup/install/files/lib/system/search/acp/OptionACPSearchResultProvider.class.php b/wcfsetup/install/files/lib/system/search/acp/OptionACPSearchResultProvider.class.php index 0a7346599e..0cb4668232 100644 --- a/wcfsetup/install/files/lib/system/search/acp/OptionACPSearchResultProvider.class.php +++ b/wcfsetup/install/files/lib/system/search/acp/OptionACPSearchResultProvider.class.php @@ -1,5 +1,7 @@ getData([], 'categories'); - while ($option = $statement->fetchObject('wcf\data\option\Option')) { + while ($option = $statement->fetchObject(Option::class)) { // category is not accessible if (!$this->isValid($option->categoryName)) { continue; diff --git a/wcfsetup/install/files/lib/system/search/acp/PackageACPSearchResultProvider.class.php b/wcfsetup/install/files/lib/system/search/acp/PackageACPSearchResultProvider.class.php index 013eb70023..641565393a 100644 --- a/wcfsetup/install/files/lib/system/search/acp/PackageACPSearchResultProvider.class.php +++ b/wcfsetup/install/files/lib/system/search/acp/PackageACPSearchResultProvider.class.php @@ -1,5 +1,6 @@ getParameters())); - while ($package = $statement->fetchObject('wcf\data\package\Package')) { + while ($package = $statement->fetchObject(Package::class)) { $results[] = new ACPSearchResult($package->getName(), LinkHandler::getInstance()->getLink('Package', [ 'id' => $package->packageID, 'title' => $package->getName() diff --git a/wcfsetup/install/files/lib/system/search/acp/UserACPSearchResultProvider.class.php b/wcfsetup/install/files/lib/system/search/acp/UserACPSearchResultProvider.class.php index 441e651b08..635da14699 100644 --- a/wcfsetup/install/files/lib/system/search/acp/UserACPSearchResultProvider.class.php +++ b/wcfsetup/install/files/lib/system/search/acp/UserACPSearchResultProvider.class.php @@ -1,6 +1,7 @@ prepareStatement($sql); $statement->execute([$query.'%']); - while ($user = $statement->fetchObject('wcf\data\user\User')) { + while ($user = $statement->fetchObject(User::class)) { if (UserGroup::isAccessibleGroup($user->getGroupIDs())) { $results[] = new ACPSearchResult($user->username, LinkHandler::getInstance()->getLink('UserEdit', [ 'object' => $user diff --git a/wcfsetup/install/files/lib/system/search/acp/UserGroupOptionACPSearchResultProvider.class.php b/wcfsetup/install/files/lib/system/search/acp/UserGroupOptionACPSearchResultProvider.class.php index a64e4af8f2..1c59f004f2 100644 --- a/wcfsetup/install/files/lib/system/search/acp/UserGroupOptionACPSearchResultProvider.class.php +++ b/wcfsetup/install/files/lib/system/search/acp/UserGroupOptionACPSearchResultProvider.class.php @@ -1,5 +1,7 @@ getData([], 'categories'); - while ($userGroupOption = $statement->fetchObject('wcf\data\user\group\option\UserGroupOption')) { + while ($userGroupOption = $statement->fetchObject(UserGroupOption::class)) { // category is not accessible if (!$this->isValid($userGroupOption->categoryName)) { continue; diff --git a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php index 9390e74fd7..aa421c1e85 100644 --- a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php +++ b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php @@ -6,6 +6,7 @@ use wcf\data\acp\session\virtual\ACPSessionVirtualEditor; use wcf\data\session\virtual\SessionVirtual; use wcf\data\session\virtual\SessionVirtualAction; use wcf\data\session\virtual\SessionVirtualEditor; +use wcf\data\session\SessionEditor; use wcf\data\user\User; use wcf\data\user\UserEditor; use wcf\page\ITrackablePage; @@ -493,7 +494,7 @@ class SessionHandler extends SingletonFactory { */ protected function create() { $spiderID = null; - if ($this->sessionEditorClassName == 'wcf\data\session\SessionEditor') { + if ($this->sessionEditorClassName == SessionEditor::class) { // get spider information $spiderID = $this->getSpiderID(UserUtil::getUserAgent()); if ($spiderID !== null) { diff --git a/wcfsetup/install/files/lib/system/tagging/TagEngine.class.php b/wcfsetup/install/files/lib/system/tagging/TagEngine.class.php index 5add9f646c..a04c5422de 100644 --- a/wcfsetup/install/files/lib/system/tagging/TagEngine.class.php +++ b/wcfsetup/install/files/lib/system/tagging/TagEngine.class.php @@ -175,7 +175,7 @@ class TagEngine extends SingletonFactory { $statement->execute($conditions->getParameters()); $tags = []; - while ($tag = $statement->fetchObject('wcf\data\tag\Tag')) { + while ($tag = $statement->fetchObject(Tag::class)) { if (!isset($tags[$tag->objectID])) { $tags[$tag->objectID] = []; } diff --git a/wcfsetup/install/files/lib/system/user/authentication/DefaultUserAuthentication.class.php b/wcfsetup/install/files/lib/system/user/authentication/DefaultUserAuthentication.class.php index 07a7928880..7f4410aaf7 100644 --- a/wcfsetup/install/files/lib/system/user/authentication/DefaultUserAuthentication.class.php +++ b/wcfsetup/install/files/lib/system/user/authentication/DefaultUserAuthentication.class.php @@ -34,7 +34,7 @@ class DefaultUserAuthentication extends AbstractUserAuthentication { /** * @inheritDoc */ - public function loginManually($username, $password, $userClassname = 'wcf\data\user\User') { + public function loginManually($username, $password, $userClassname = User::class) { $user = $this->getUserByLogin($username); $userSession = (get_class($user) == $userClassname ? $user : new $userClassname(null, null, $user)); @@ -53,7 +53,7 @@ class DefaultUserAuthentication extends AbstractUserAuthentication { /** * @inheritDoc */ - public function loginAutomatically($persistent = false, $userClassname = 'wcf\data\user\User') { + public function loginAutomatically($persistent = false, $userClassname = User::class) { if (!$persistent) return null; $user = null; @@ -87,7 +87,7 @@ class DefaultUserAuthentication extends AbstractUserAuthentication { * @param string $userClassname * @return \wcf\data\user\User */ - protected function getUserAutomatically($userID, $password, $userClassname = 'wcf\data\user\User') { + protected function getUserAutomatically($userID, $password, $userClassname = User::class) { $user = new $userClassname($userID); if (!$user->userID || !$this->checkCookiePassword($user, $password)) { $user = null; diff --git a/wcfsetup/install/files/lib/system/user/authentication/IUserAuthentication.class.php b/wcfsetup/install/files/lib/system/user/authentication/IUserAuthentication.class.php index aa28f3460f..f3c2061fc3 100644 --- a/wcfsetup/install/files/lib/system/user/authentication/IUserAuthentication.class.php +++ b/wcfsetup/install/files/lib/system/user/authentication/IUserAuthentication.class.php @@ -44,7 +44,7 @@ interface IUserAuthentication { * @param string $userClassname class name of user class * @return \wcf\data\user\User */ - public function loginManually($username, $password, $userClassname = 'wcf\data\user\User'); + public function loginManually($username, $password, $userClassname = User::class); /** * Does a user login automatically. @@ -53,5 +53,5 @@ interface IUserAuthentication { * @param string $userClassname class name of user class * @return \wcf\data\user\User */ - public function loginAutomatically($persistent = false, $userClassname = 'wcf\data\user\User'); + public function loginAutomatically($persistent = false, $userClassname = User::class); } diff --git a/wcfsetup/install/files/lib/system/user/authentication/UserAuthenticationFactory.class.php b/wcfsetup/install/files/lib/system/user/authentication/UserAuthenticationFactory.class.php index 82e675631a..ebbdd448d6 100644 --- a/wcfsetup/install/files/lib/system/user/authentication/UserAuthenticationFactory.class.php +++ b/wcfsetup/install/files/lib/system/user/authentication/UserAuthenticationFactory.class.php @@ -19,7 +19,7 @@ class UserAuthenticationFactory extends SingletonFactory { * user authentication class name * @var string */ - public $className = 'wcf\system\user\authentication\DefaultUserAuthentication'; + public $className = DefaultUserAuthentication::class; /** * user authentication instance @@ -34,8 +34,8 @@ class UserAuthenticationFactory extends SingletonFactory { // call loadInstance event EventHandler::getInstance()->fireAction($this, 'init'); - if (!is_subclass_of($this->className, 'wcf\system\user\authentication\IUserAuthentication')) { - throw new SystemException("'" . $this->className . "' does not implement 'wcf\system\user\authentication\IUserAuthentication'"); + if (!is_subclass_of($this->className, IUserAuthentication::class)) { + throw new SystemException("'" . $this->className . "' does not implement '".IUserAuthentication::class."'"); } $this->userAuthentication = call_user_func([$this->className, 'getInstance']); diff --git a/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php b/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php index 72ef8d6081..ae6358e778 100644 --- a/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php @@ -374,7 +374,7 @@ class UserNotificationHandler extends SingletonFactory { $statement->execute($conditions->getParameters()); $notifications = []; - while ($notification = $statement->fetchObject('\wcf\data\user\notification\UserNotification')) { + while ($notification = $statement->fetchObject(UserNotification::class)) { $notifications[$notification->notificationID] = $notification; } diff --git a/wcfsetup/install/files/lib/system/user/notification/object/type/LikeUserNotificationObjectType.class.php b/wcfsetup/install/files/lib/system/user/notification/object/type/LikeUserNotificationObjectType.class.php index 4986d50f42..4d85882d99 100644 --- a/wcfsetup/install/files/lib/system/user/notification/object/type/LikeUserNotificationObjectType.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/object/type/LikeUserNotificationObjectType.class.php @@ -1,5 +1,8 @@ objectListClassName, 'wcf\data\DatabaseObjectList')) { - throw new SystemException("'".$this->objectListClassName."' does not extend 'wcf\data\DatabaseObjectList'"); + if (!is_subclass_of($this->objectListClassName, DatabaseObjectList::class)) { + throw new SystemException("'".$this->objectListClassName."' does not extend '".DatabaseObjectList::class."'"); } $this->objectList = new $this->objectListClassName(); diff --git a/wcfsetup/install/files/lib/system/worker/AttachmentRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/AttachmentRebuildDataWorker.class.php index 659cae2d11..a04242082e 100644 --- a/wcfsetup/install/files/lib/system/worker/AttachmentRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/AttachmentRebuildDataWorker.class.php @@ -1,6 +1,7 @@ decoratorClassName = 'wcf\data\user\UserEditor'; + $userList->decoratorClassName = UserEditor::class; $userList->getConditionBuilder()->add('user_table.userID IN (?)', [$this->parameters['userIDs']]); $userList->sqlLimit = $this->limit; $userList->sqlOffset = $this->limit * $this->loopCount; diff --git a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php index c2f2130206..95167f4b67 100644 --- a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php @@ -2,6 +2,7 @@ namespace wcf\system\worker; use wcf\data\like\Like; use wcf\data\user\UserEditor; +use wcf\data\user\UserList; use wcf\data\user\UserProfileAction; use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\user\activity\point\UserActivityPointHandler; @@ -21,7 +22,7 @@ class UserRebuildDataWorker extends AbstractRebuildDataWorker { /** * @inheritDoc */ - protected $objectListClassName = 'wcf\data\user\UserList'; + protected $objectListClassName = UserList::class; /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/util/HeaderUtil.class.php b/wcfsetup/install/files/lib/util/HeaderUtil.class.php index f76d29829e..13244aee78 100644 --- a/wcfsetup/install/files/lib/util/HeaderUtil.class.php +++ b/wcfsetup/install/files/lib/util/HeaderUtil.class.php @@ -81,7 +81,7 @@ final class HeaderUtil { @header('X-Frame-Options: SAMEORIGIN'); } - ob_start(['wcf\util\HeaderUtil', 'parseOutput']); + ob_start([self::class, 'parseOutput']); } /** @@ -120,7 +120,7 @@ final class HeaderUtil { // 3rd party plugins may differ the actual output before it is sent to the browser // please be aware, that $eventObj is not available here due to this being a static // class. Use HeaderUtil::$output to modify it. - if (!defined('NO_IMPORTS')) EventHandler::getInstance()->fireAction('wcf\util\HeaderUtil', 'parseOutput'); + if (!defined('NO_IMPORTS')) EventHandler::getInstance()->fireAction(self::class, 'parseOutput'); // gzip compression if (self::$enableGzipCompression) { -- 2.20.1