<?php
namespace wcf\acp\action;
use wcf\action\AbstractDialogAction;
+use wcf\data\application\Application;
use wcf\data\package\installation\queue\PackageInstallationQueue;
use wcf\system\cache\CacheHandler;
use wcf\system\exception\IllegalLinkException;
WHERE packageID = ?";
$statement = WCF::getDB()->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/';
<?php
namespace wcf\acp\action;
use wcf\action\AbstractDialogAction;
+use wcf\data\application\Application;
use wcf\data\package\installation\queue\PackageInstallationQueue;
use wcf\data\package\installation\queue\PackageInstallationQueueEditor;
use wcf\data\package\Package;
WHERE packageID = ?";
$statement = WCF::getDB()->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/';
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;
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."'");
}
}
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.
* option handler class name
* @var string
*/
- public $optionHandlerClassName = 'wcf\system\option\OptionHandler';
+ public $optionHandlerClassName = OptionHandler::class;
/**
* true if option supports i18n
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.
/**
* @inheritDoc
*/
- public $optionHandlerClassName = 'wcf\system\option\user\UserOptionHandler';
+ public $optionHandlerClassName = UserOptionHandler::class;
/**
* @inheritDoc
<?php
namespace wcf\acp\page;
+use wcf\data\acp\session\log\ACPSessionLogList;
use wcf\page\SortablePage;
/**
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\acp\session\log\ACPSessionLogList';
+ public $objectListClassName = ACPSessionLogList::class;
/**
* @inheritDoc
<?php
namespace wcf\acp\page;
+use wcf\data\acp\session\access\log\ACPSessionAccessLogList;
use wcf\data\acp\session\log\ACPSessionLog;
use wcf\page\SortablePage;
use wcf\system\exception\IllegalLinkException;
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\acp\session\access\log\ACPSessionAccessLogList';
+ public $objectListClassName = ACPSessionAccessLogList::class;
/**
* @inheritDoc
<?php
namespace wcf\acp\page;
+use wcf\data\ad\AdList;
use wcf\page\MultipleLinkPage;
/**
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\ad\AdList';
+ public $objectListClassName = AdList::class;
/**
* @inheritDoc
<?php
namespace wcf\acp\page;
+use wcf\data\attachment\AdministrativeAttachmentList;
use wcf\data\object\type\ObjectTypeCache;
use wcf\data\user\User;
use wcf\page\SortablePage;
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\attachment\AdministrativeAttachmentList';
+ public $objectListClassName = AdministrativeAttachmentList::class;
/**
* username
<?php
namespace wcf\acp\page;
+use wcf\data\bbcode\BBCodeList;
use wcf\page\SortablePage;
/**
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\bbcode\BBCodeList';
+ public $objectListClassName = BBCodeList::class;
/**
* @inheritDoc
<?php
namespace wcf\acp\page;
+use wcf\data\bbcode\media\provider\BBCodeMediaProviderList;
use wcf\page\SortablePage;
/**
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\bbcode\media\provider\BBCodeMediaProviderList';
+ public $objectListClassName = BBCodeMediaProviderList::class;
/**
* @inheritDoc
<?php
namespace wcf\acp\page;
use wcf\data\box\Box;
+use wcf\data\box\BoxList;
use wcf\page\SortablePage;
use wcf\system\WCF;
use wcf\util\StringUtil;
/**
* @inheritdoc
*/
- public $objectListClassName = 'wcf\data\box\BoxList';
+ public $objectListClassName = BoxList::class;
/**
* @inheritdoc
<?php
namespace wcf\acp\page;
+use wcf\data\captcha\question\CaptchaQuestionList;
use wcf\page\MultipleLinkPage;
/**
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\captcha\question\CaptchaQuestionList';
+ public $objectListClassName = CaptchaQuestionList::class;
/**
* @inheritDoc
<?php
namespace wcf\acp\page;
+use wcf\data\cronjob\CronjobList;
use wcf\page\SortablePage;
/**
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\cronjob\CronjobList';
+ public $objectListClassName = CronjobList::class;
/**
* @inheritDoc
<?php
namespace wcf\acp\page;
+use wcf\data\cronjob\log\CronjobLogList;
use wcf\page\SortablePage;
/**
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\cronjob\log\CronjobLogList';
+ public $objectListClassName = CronjobLogList::class;
/**
* @inheritDoc
<?php
namespace wcf\acp\page;
+use wcf\data\label\group\LabelGroupList;
use wcf\page\SortablePage;
/**
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\label\group\LabelGroupList';
+ public $objectListClassName = LabelGroupList::class;
}
<?php
namespace wcf\acp\page;
+use wcf\data\language\LanguageList;
use wcf\page\SortablePage;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\language\LanguageList';
+ public $objectListClassName = LanguageList::class;
/**
* @inheritDoc
<?php
namespace wcf\acp\page;
+use wcf\data\menu\MenuList;
use wcf\page\SortablePage;
/**
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\menu\MenuList';
+ public $objectListClassName = MenuList::class;
/**
* @inheritDoc
<?php
namespace wcf\acp\page;
+use wcf\data\notice\NoticeList;
use wcf\page\SortablePage;
/**
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\notice\NoticeList';
+ public $objectListClassName = NoticeList::class;
/**
* @inheritDoc
<?php
namespace wcf\acp\page;
+use wcf\data\package\PackageList;
use wcf\page\SortablePage;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\package\PackageList';
+ public $objectListClassName = PackageList::class;
/**
* @inheritDoc
<?php
namespace wcf\acp\page;
+use wcf\data\package\update\server\PackageUpdateServerList;
use wcf\page\SortablePage;
/**
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\package\update\server\PackageUpdateServerList';
+ public $objectListClassName = PackageUpdateServerList::class;
/**
* @inheritDoc
namespace wcf\acp\page;
use wcf\data\application\Application;
use wcf\data\application\ApplicationList;
+use wcf\data\page\PageList;
use wcf\page\SortablePage;
use wcf\system\WCF;
use wcf\util\StringUtil;
/**
* @inheritdoc
*/
- public $objectListClassName = 'wcf\data\page\PageList';
+ public $objectListClassName = PageList::class;
/**
* @inheritdoc
<?php
namespace wcf\acp\page;
+use wcf\data\paid\subscription\PaidSubscriptionList;
use wcf\page\SortablePage;
/**
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\paid\subscription\PaidSubscriptionList';
+ public $objectListClassName = PaidSubscriptionList::class;
}
<?php
namespace wcf\acp\page;
+use wcf\data\paid\subscription\transaction\log\PaidSubscriptionTransactionLogList;
use wcf\page\SortablePage;
use wcf\system\cache\builder\PaidSubscriptionCacheBuilder;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\paid\subscription\transaction\log\PaidSubscriptionTransactionLogList';
+ public $objectListClassName = PaidSubscriptionTransactionLogList::class;
/**
* transaction id
<?php
namespace wcf\acp\page;
+use wcf\data\paid\subscription\user\PaidSubscriptionUserList;
use wcf\page\SortablePage;
/**
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\paid\subscription\user\PaidSubscriptionUserList';
+ public $objectListClassName = PaidSubscriptionUserList::class;
/**
* Initializes DatabaseObjectList instance.
use wcf\data\category\Category;
use wcf\data\smiley\category\SmileyCategory;
use wcf\data\smiley\SmileyCache;
+use wcf\data\smiley\SmileyList;
use wcf\page\MultipleLinkPage;
use wcf\system\exception\IllegalLinkException;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\smiley\SmileyList';
+ public $objectListClassName = SmileyList::class;
/**
* @inheritDoc
<?php
namespace wcf\acp\page;
+use wcf\data\style\StyleList;
use wcf\page\MultipleLinkPage;
/**
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\style\StyleList';
+ public $objectListClassName = StyleList::class;
/**
* @inheritDoc
<?php
namespace wcf\acp\page;
+use wcf\data\tag\TagList;
use wcf\page\SortablePage;
use wcf\system\clipboard\ClipboardHandler;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\tag\TagList';
+ public $objectListClassName = TagList::class;
/**
* search-query
<?php
namespace wcf\acp\page;
+use wcf\data\template\group\TemplateGroupList;
use wcf\page\SortablePage;
/**
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\template\group\TemplateGroupList';
+ public $objectListClassName = TemplateGroupList::class;
/**
* @inheritDoc
namespace wcf\acp\page;
use wcf\data\package\PackageCache;
use wcf\data\template\group\TemplateGroup;
+use wcf\data\template\TemplateList;
use wcf\page\SortablePage;
use wcf\system\application\ApplicationHandler;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\template\TemplateList';
+ public $objectListClassName = TemplateList::class;
/**
* @inheritDoc
<?php
namespace wcf\acp\page;
+use wcf\data\user\authentication\failure\UserAuthenticationFailureList;
use wcf\page\SortablePage;
/**
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\user\authentication\failure\UserAuthenticationFailureList';
+ public $objectListClassName = UserAuthenticationFailureList::class;
}
<?php
namespace wcf\acp\page;
+use wcf\data\user\group\assignment\UserGroupAssignmentList;
use wcf\page\MultipleLinkPage;
/**
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\user\group\assignment\UserGroupAssignmentList';
+ public $objectListClassName = UserGroupAssignmentList::class;
}
<?php
namespace wcf\acp\page;
+use wcf\data\user\group\UserGroupList;
use wcf\page\SortablePage;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\user\group\UserGroupList';
+ public $objectListClassName = UserGroupList::class;
/**
* indicates if a group has just been deleted
<?php
namespace wcf\acp\page;
+use wcf\data\user\option\category\UserOptionCategoryList;
use wcf\page\SortablePage;
/**
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\user\option\category\UserOptionCategoryList';
+ public $objectListClassName = UserOptionCategoryList::class;
/**
* @inheritDoc
<?php
namespace wcf\acp\page;
+use wcf\data\user\option\UserOptionList;
use wcf\page\SortablePage;
/**
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\user\option\UserOptionList';
+ public $objectListClassName = UserOptionList::class;
/**
* @inheritDoc
<?php
namespace wcf\acp\page;
+use wcf\data\user\rank\UserRankList;
use wcf\page\SortablePage;
/**
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\user\rank\UserRankList';
+ public $objectListClassName = UserRankList::class;
/**
* @inheritDoc
<?php
namespace wcf\action;
+use wcf\data\IDatabaseObjectAction;
use wcf\system\exception\SystemException;
use wcf\system\WCF;
use wcf\util\ArrayUtil;
* @inheritDoc
*/
protected function invoke() {
- if (!is_subclass_of($this->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)) {
* 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']);
}
}
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;
<?php
namespace wcf\data;
use wcf\system\exception\SystemException;
+use wcf\system\SingletonFactory;
/**
* Abstract class for all processible data holder classes.
throw new SystemException("'".$this->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);
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\acl\option\ACLOptionEditor';
+ protected $className = ACLOptionEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\acl\option\category\ACLOptionCategoryEditor';
+ protected $className = ACLOptionCategoryEditor::class;
}
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\acp\menu\item\ACPMenuItemEditor';
+ protected $className = ACPMenuItemEditor::class;
}
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\acp\session\access\log\ACPSessionAccessLogEditor';
+ protected $className = ACPSessionAccessLogEditor::class;
}
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\acp\session\log\ACPSessionLogEditor';
+ protected $className = ACPSessionLogEditor::class;
}
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\acp\template\ACPTemplateEditor';
+ protected $className = ACPTemplateEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\bbcode\BBCodeEditor';
+ protected $className = BBCodeEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\bbcode\attribute\BBCodeAttributeEditor';
+ protected $className = BBCodeAttributeEditor::class;
}
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\bbcode\media\provider\BBCodeMediaProviderEditor';
+ protected $className = BBCodeMediaProviderEditor::class;
/**
* @inheritDoc
// 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);
}
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\clipboard\action\ClipboardActionEditor';
+ protected $className = ClipboardActionEditor::class;
}
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\comment\response\CommentResponseEditor';
+ protected $className = CommentResponseEditor::class;
/**
* comment object
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\core\object\CoreObjectEditor';
+ protected $className = CoreObjectEditor::class;
}
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\cronjob\CronjobEditor';
+ protected $className = CronjobEditor::class;
/**
* @inheritDoc
<?php
namespace wcf\data\cronjob;
+use wcf\data\language\category\LanguageCategory;
use wcf\data\language\LanguageList;
use wcf\data\DatabaseObjectEditor;
use wcf\data\IEditableCachedObject;
WHERE languageCategory = ?";
$statement = WCF::getDB()->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();
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\cronjob\log\CronjobLogEditor';
+ protected $className = CronjobLogEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\edit\history\entry\EditHistoryEntryEditor';
+ protected $className = EditHistoryEntryEditor::class;
/**
* Checks permissions to revert.
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\event\listener\EventListenerEditor';
+ protected $className = EventListenerEditor::class;
}
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\label\group\LabelGroupEditor';
+ protected $className = LabelGroupEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\language\LanguageEditor';
+ protected $className = LanguageEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\language\category\LanguageCategoryEditor';
+ protected $className = LanguageCategoryEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\language\item\LanguageItemEditor';
+ protected $className = LanguageItemEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\like\LikeEditor';
+ protected $className = LikeEditor::class;
/**
* likeable object
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\moderation\queue\ModerationQueueEditor';
+ protected $className = ModerationQueueEditor::class;
/**
* moderation queue editor object
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\object\type\ObjectTypeEditor';
+ protected $className = ObjectTypeEditor::class;
}
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\object\type\definition\ObjectTypeDefinitionEditor';
+ protected $className = ObjectTypeDefinitionEditor::class;
}
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\option\OptionEditor';
+ protected $className = OptionEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\option\category\OptionCategoryEditor';
+ protected $className = OptionCategoryEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\package\PackageEditor';
+ protected $className = PackageEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\package\installation\plugin\PackageInstallationPluginEditor';
+ protected $className = PackageInstallationPluginEditor::class;
}
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\package\installation\queue\PackageInstallationQueueEditor';
+ protected $className = PackageInstallationQueueEditor::class;
/**
* queue of the canceled installation
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;
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\package\update\PackageUpdateEditor';
+ protected $className = PackageUpdateEditor::class;
/**
* @inheritDoc
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);
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);
$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
$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;
}
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\package\update\server\PackageUpdateServerEditor';
+ protected $className = PackageUpdateServerEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\package\update\version\PackageUpdateVersionEditor';
+ protected $className = PackageUpdateVersionEditor::class;
}
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\poll\PollEditor';
+ protected $className = PollEditor::class;
/**
* poll object
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\poll\option\PollOptionEditor';
+ protected $className = PollOptionEditor::class;
}
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\search\SearchEditor';
+ protected $className = SearchEditor::class;
}
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\search\keyword\SearchKeywordEditor';
+ protected $className = SearchKeywordEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\session\SessionEditor';
+ protected $className = SessionEditor::class;
/**
* list of data values returned upon a keep alive request
use wcf\data\TDatabaseObjectOptions;
use wcf\data\TDatabaseObjectPermissions;
use wcf\system\exception\SystemException;
+use wcf\system\sitemap\ISitemapProvider;
/**
* Represents a sitemap entry.
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();
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\smiley\SmileyEditor';
+ protected $className = SmileyEditor::class;
/**
* @inheritDoc
<?php
namespace wcf\data\smiley\category;
+use wcf\data\category\CategoryEditor;
use wcf\data\AbstractDatabaseObjectAction;
use wcf\system\exception\IllegalLinkException;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\category\CategoryEditor';
+ protected $className = CategoryEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\spider\SpiderEditor';
+ protected $className = SpiderEditor::class;
}
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\stat\daily\StatDailyEditor';
+ protected $className = StatDailyEditor::class;
/**
* Validates the getData action.
/**
* @inheritdoc
*/
- protected $className = 'wcf\data\style\StyleEditor';
+ protected $className = StyleEditor::class;
/**
* @inheritdoc
<?php
namespace wcf\data\style;
+use wcf\data\language\category\LanguageCategory;
use wcf\data\language\LanguageList;
use wcf\data\package\Package;
use wcf\data\package\PackageCache;
WHERE languageCategory = ?";
$statement2 = WCF::getDB()->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');
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\style\variable\StyleVariableEditor';
+ protected $className = StyleVariableEditor::class;
}
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\tag\TagEditor';
+ protected $className = TagEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\template\TemplateEditor';
+ protected $className = TemplateEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- public $className = 'wcf\data\template\Template';
+ public $className = Template::class;
/**
* Creates a new TemplateList object.
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\template\group\TemplateGroupEditor';
+ protected $className = TemplateGroupEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\template\listener\TemplateListenerEditor';
+ protected $className = TemplateListenerEditor::class;
}
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\user\follow\UserFollowEditor';
+ protected $className = UserFollowEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- public $className = 'wcf\data\user\group\UserGroupEditor';
+ public $className = UserGroupEditor::class;
/**
* editor object for the copied user group
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\user\group\option\UserGroupOptionEditor';
+ protected $className = UserGroupOptionEditor::class;
/**
* Updates option values for given option id.
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\user\group\option\category\UserGroupOptionCategoryEditor';
+ protected $className = UserGroupOptionCategoryEditor::class;
}
<?php
namespace wcf\data\user\ignore;
+use wcf\data\user\User;
+use wcf\data\user\UserProfile;
/**
* Represents a list of ignored users.
/**
* @inheritDoc
*/
- public $className = 'wcf\data\user\ignore\UserIgnore';
+ public $className = UserIgnore::class;
/**
* @inheritDoc
*/
- public $decoratorClassName = 'wcf\data\user\UserProfile';
+ public $decoratorClassName = UserProfile::class;
/**
* @inheritDoc
*/
- public $objectClassName = 'wcf\data\user\User';
+ public $objectClassName = User::class;
/**
* @inheritDoc
namespace wcf\data\user\menu\item;
use wcf\data\ProcessibleDatabaseObject;
use wcf\system\menu\user\DefaultUserMenuItemProvider;
+use wcf\system\menu\user\IUserMenuItemProvider;
use wcf\system\menu\ITreeMenuItem;
use wcf\system\request\LinkHandler;
use wcf\system\Regex;
/**
* @inheritDoc
*/
- protected static $processorInterface = 'wcf\system\menu\user\IUserMenuItemProvider';
+ protected static $processorInterface = IUserMenuItemProvider::class;
/**
* application abbreviation
use wcf\data\ProcessibleDatabaseObject;
use wcf\data\TDatabaseObjectOptions;
use wcf\data\TDatabaseObjectPermissions;
+use wcf\system\user\notification\event\IUserNotificationEvent;
/**
* Represents a user notification event.
/**
* @inheritDoc
*/
- protected static $processorInterface = 'wcf\system\user\notification\event\IUserNotificationEvent';
+ protected static $processorInterface = IUserNotificationEvent::class;
}
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\user\option\UserOptionEditor';
+ protected $className = UserOptionEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\user\option\category\UserOptionCategoryEditor';
+ protected $className = UserOptionCategoryEditor::class;
/**
* @inheritDoc
}
if (!is_subclass_of($this->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']);
<?php
namespace wcf\page;
+use wcf\data\user\follow\UserFollowingList;
use wcf\system\menu\user\UserMenu;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\user\follow\UserFollowingList';
+ public $objectListClassName = UserFollowingList::class;
/**
* @inheritDoc
<?php
namespace wcf\page;
+use wcf\data\user\ignore\ViewableUserIgnoreList;
use wcf\system\menu\user\UserMenu;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\user\ignore\ViewableUserIgnoreList';
+ public $objectListClassName = ViewableUserIgnoreList::class;
/**
* @inheritDoc
namespace wcf\page;
use wcf\data\search\Search;
use wcf\data\user\User;
+use wcf\data\user\UserProfileList;
use wcf\system\database\PostgreSQLDatabase;
use wcf\system\exception\IllegalLinkException;
use wcf\system\request\LinkHandler;
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\user\UserProfileList';
+ public $objectListClassName = UserProfileList::class;
/**
* letter
<?php
namespace wcf\page;
use wcf\data\moderation\queue\ModerationQueue;
+use wcf\data\moderation\queue\ViewableModerationQueueList;
use wcf\system\exception\IllegalLinkException;
use wcf\system\moderation\queue\ModerationQueueManager;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- public $objectListClassName = 'wcf\data\moderation\queue\ViewableModerationQueueList';
+ public $objectListClassName = ViewableModerationQueueList::class;
/**
* status bit
<?php
namespace wcf\page;
+use wcf\data\DatabaseObjectList;
use wcf\system\event\EventHandler;
use wcf\system\exception\SystemException;
use wcf\system\WCF;
throw new SystemException('DatabaseObjectList class name not specified.');
}
- if (!is_subclass_of($this->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();
$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;
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.
$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();
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;
// 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
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;
}
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
}
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']);
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;
* @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+
];
}
}
// check innodb support
- if ($dbClass == 'wcf\system\database\MySQLDatabase') {
+ if ($dbClass == MySQLDatabase::class) {
$sql = "SHOW ENGINES";
$statement = $db->prepareStatement($sql);
$statement->execute();
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.
* @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);
}
}
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.'\'.');
}
}
<?php
namespace wcf\system\bbcode;
+use wcf\system\bbcode\highlighter\BashHighlighter;
+use wcf\system\bbcode\highlighter\BrainfuckHighlighter;
+use wcf\system\bbcode\highlighter\CHighlighter;
+use wcf\system\bbcode\highlighter\DiffHighlighter;
+use wcf\system\bbcode\highlighter\HtmlHighlighter;
+use wcf\system\bbcode\highlighter\JavaHighlighter;
+use wcf\system\bbcode\highlighter\JsHighlighter;
+use wcf\system\bbcode\highlighter\PerlHighlighter;
+use wcf\system\bbcode\highlighter\PhpHighlighter;
+use wcf\system\bbcode\highlighter\PlainHighlighter;
+use wcf\system\bbcode\highlighter\PythonHighlighter;
+use wcf\system\bbcode\highlighter\SqlHighlighter;
+use wcf\system\bbcode\highlighter\TexHighlighter;
+use wcf\system\bbcode\highlighter\XmlHighlighter;
use wcf\system\Regex;
use wcf\system\WCF;
use wcf\util\StringUtil;
$this->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
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, '<?php') !== false) {
- $className = '\wcf\system\bbcode\highlighter\PhpHighlighter';
+ $className = PhpHighlighter::class;
}
else if (mb_strpos($content, '<html') !== false) {
- $className = '\wcf\system\bbcode\highlighter\HtmlHighlighter';
+ $className = HtmlHighlighter::class;
}
else if (mb_strpos($content, '<?xml') === 0) {
- $className = '\wcf\system\bbcode\highlighter\XmlHighlighter';
+ $className = XmlHighlighter::class;
}
else if ( mb_strpos($content, 'SELECT') === 0
|| mb_strpos($content, 'UPDATE') === 0
|| mb_strpos($content, 'INSERT') === 0
|| mb_strpos($content, 'DELETE') === 0) {
- $className = '\wcf\system\bbcode\highlighter\SqlHighlighter';
+ $className = SqlHighlighter::class;
}
else if (mb_strpos($content, 'import java.') !== false) {
- $className = '\wcf\system\bbcode\highlighter\JavaHighlighter';
+ $className = JavaHighlighter::class;
}
else if ( mb_strpos($content, "---") !== false
&& mb_strpos($content, "\n+++") !== false) {
- $className = '\wcf\system\bbcode\highlighter\DiffHighlighter';
+ $className = DiffHighlighter::class;
}
else if (mb_strpos($content, "\n#include ") !== false) {
- $className = '\wcf\system\bbcode\highlighter\CHighlighter';
+ $className = CHighlighter::class;
}
else if (mb_strpos($content, '#!/usr/bin/perl') === 0) {
- $className = '\wcf\system\bbcode\highlighter\PerlHighlighter';
+ $className = PerlHighlighter::class;
}
else if (mb_strpos($content, 'def __init__(self') !== false) {
- $className = '\wcf\system\bbcode\highlighter\PythonHighlighter';
+ $className = PythonHighlighter::class;
}
else if (Regex::compile('^#!/bin/(ba|z)?sh')->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') {
<?php
namespace wcf\system\cache\builder;
+use wcf\acp\form\OptionForm;
use wcf\data\acp\menu\item\ACPMenuItem;
use wcf\data\acp\menu\item\ACPMenuItemList;
use wcf\data\option\category\OptionCategory;
$data['wcf.acp.menu.link.option.category'][] = new ACPMenuItem(null, [
'menuItem' => '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
<?php
namespace wcf\system\cache\builder;
+use wcf\data\event\listener\EventListener;
use wcf\system\event\EventHandler;
use wcf\system\WCF;
ORDER BY niceValue ASC, listenerClassName ASC";
$statement = WCF::getDB()->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) {
<?php
namespace wcf\system\cache\builder;
use wcf\data\option\category\OptionCategory;
+use wcf\data\option\Option;
use wcf\system\WCF;
/**
* option class name
* @var string
*/
- protected $optionClassName = 'wcf\data\option\Option';
+ protected $optionClassName = Option::class;
/**
* database table name
<?php
namespace wcf\system\cache\builder;
+use wcf\data\smiley\Smiley;
use wcf\system\WCF;
/**
ORDER BY showOrder";
$statement = WCF::getDB()->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;
<?php
namespace wcf\system\cache\builder;
+use wcf\data\user\group\option\UserGroupOption;
/**
* Caches user group options and categories
/**
* @inheritDoc
*/
- protected $optionClassName = 'wcf\data\user\group\option\UserGroupOption';
+ protected $optionClassName = UserGroupOption::class;
/**
* @inheritDoc
if (!class_exists($className)) {
throw new SystemException("unable to find class '".$className."'");
}
- 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."'");
}
// create instance
<?php
namespace wcf\system\cache\builder;
use wcf\data\user\menu\item\UserMenuItem;
+use wcf\form\SettingsForm;
use wcf\system\WCF;
/**
'packageID' => $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']
<?php
namespace wcf\system\cache\builder;
+use wcf\data\user\option\UserOption;
/**
* Caches user options and categories
/**
* @inheritDoc
*/
- protected $optionClassName = 'wcf\data\user\option\UserOption';
+ protected $optionClassName = UserOption::class;
/**
* @inheritDoc
<?php
namespace wcf\system\cache\builder;
+use wcf\data\user\User;
use wcf\system\WCF;
/**
ORDER BY userID DESC";
$statement = WCF::getDB()->prepareStatement($sql, 1);
$statement->execute();
- $data['newestMember'] = $statement->fetchObject('wcf\data\user\User');
+ $data['newestMember'] = $statement->fetchObject(User::class);
return $data;
}
<?php
namespace wcf\system\cli\command;
use phpline\internal\Log;
+use wcf\system\worker\IWorker;
use wcf\system\CLIWCF;
use wcf\system\Regex;
use wcf\util\CLIUtil;
if (!$reflection->isInstantiable()) {
$invalid = true;
}
- else if (!is_subclass_of($class, 'wcf\system\worker\IWorker')) {
+ else if (!is_subclass_of($class, IWorker::class)) {
$invalid = true;
}
}
$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;
}
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;
$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] = [
<?php
namespace wcf\system\clipboard\action;
use wcf\data\clipboard\action\ClipboardAction;
+use wcf\data\tag\TagAction;
use wcf\system\WCF;
/**
* @inheritDoc
*/
public function getClassName() {
- return 'wcf\data\tag\TagAction';
+ return TagAction::class;
}
/**
namespace wcf\system\clipboard\action;
use wcf\data\clipboard\action\ClipboardAction;
use wcf\data\user\group\UserGroup;
+use wcf\data\user\UserAction;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
* @inheritDoc
*/
public function getClassName() {
- return 'wcf\data\user\UserAction';
+ return UserAction::class;
}
/**
<?php
namespace wcf\system\clipboard\action;
use wcf\data\clipboard\action\ClipboardAction;
+use wcf\data\user\UserContentAction;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
* @inheritDoc
*/
public function getClassName() {
- return 'wcf\data\user\UserContentAction';
+ return UserContentAction::class;
}
/**
}
// verify class signature
- if (!(is_subclass_of($className, 'wcf\system\cronjob\ICronjob'))) {
- throw new SystemException("'".$className."' does not implement 'wcf\system\cronjob\ICronjob'");
+ if (!(is_subclass_of($className, ICronjob::class))) {
+ throw new SystemException("'".$className."' does not implement '".ICronjob::class."'");
}
// execute cronjob
<?php
namespace wcf\system\database;
use wcf\system\benchmark\Benchmark;
+use wcf\system\database\editor\DatabaseEditor;
use wcf\system\database\exception\DatabaseException as GenericDatabaseException;
use wcf\system\database\exception\DatabaseQueryException;
use wcf\system\database\exception\DatabaseTransactionException;
* name of the class used for prepared statements
* @var string
*/
- protected $preparedStatementClassName = 'wcf\system\database\statement\PreparedStatement';
+ protected $preparedStatementClassName = PreparedStatement::class;
/**
* name of the database editor class
* @var string
*/
- protected $editorClassName = 'wcf\system\database\editor\DatabaseEditor';
+ protected $editorClassName = DatabaseEditor::class;
/**
* sql server hostname
<?php
namespace wcf\system\database;
+use wcf\system\database\editor\MySQLDatabaseEditor;
use wcf\system\database\exception\DatabaseException as GenericDatabaseException;
/**
/**
* @inheritDoc
*/
- protected $editorClassName = 'wcf\system\database\editor\MySQLDatabaseEditor';
+ protected $editorClassName = MySQLDatabaseEditor::class;
/**
* @inheritDoc
<?php
namespace wcf\system\database;
+use wcf\system\database\editor\PostgreSQLDatabaseEditor;
use wcf\system\database\exception\DatabaseException as GenericDatabaseException;
use wcf\util\StringStack;
/**
* @inheritDoc
*/
- protected $editorClassName = 'wcf\system\database\editor\PostgreSQLDatabaseEditor';
+ protected $editorClassName = PostgreSQLDatabaseEditor::class;
/**
* @inheritDoc
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."'");
}
}
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."'");
}
}
<?php
namespace wcf\system\form\element;
+use wcf\util\StringUtil;
/**
* Provides a checkbox form element.
parent::setValue($value);
}
else {
- $this->value = array_map(['wcf\util\StringUtil', 'trim'], $value);
+ $this->value = array_map([StringUtil::class, 'trim'], $value);
}
}
<?php
namespace wcf\system\image;
use wcf\system\exception\SystemException;
+use wcf\system\image\adapter\GDImageAdapter;
use wcf\system\image\adapter\ImageAdapter;
+use wcf\system\image\adapter\ImagickImageAdapter;
use wcf\system\SingletonFactory;
/**
* @var string[]
*/
protected $imageAdapters = [
- 'gd' => 'wcf\system\image\adapter\GDImageAdapter',
- 'imagick' => 'wcf\system\image\adapter\ImagickImageAdapter'
+ 'gd' => GDImageAdapter::class,
+ 'imagick' => ImagickImageAdapter::class
];
/**
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\attachment\Attachment';
+ protected $className = Attachment::class;
/**
* object type id for attachments
<?php
namespace wcf\system\importer;
+use wcf\data\category\Category;
use wcf\data\category\CategoryEditor;
/**
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\category\Category';
+ protected $className = Category::class;
/**
* object type id for categories
<?php
namespace wcf\system\importer;
+use wcf\data\comment\Comment;
use wcf\data\comment\CommentEditor;
/**
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\comment\Comment';
+ protected $className = Comment::class;
/**
* object type id for comments
<?php
namespace wcf\system\importer;
+use wcf\data\comment\response\CommentResponse;
use wcf\data\comment\response\CommentResponseEditor;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\comment\response\CommentResponse';
+ protected $className = CommentResponse::class;
/**
* object type name
<?php
namespace wcf\system\importer;
+use wcf\data\like\Like;
use wcf\system\WCF;
/**
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\like\Like';
+ protected $className = Like::class;
/**
* object type id for likes
<?php
namespace wcf\system\importer;
+use wcf\data\poll\Poll;
use wcf\data\poll\PollEditor;
/**
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\poll\Poll';
+ protected $className = Poll::class;
/**
* object type id for poll
<?php
namespace wcf\system\importer;
+use wcf\data\poll\option\PollOption;
use wcf\data\poll\option\PollOptionEditor;
/**
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\poll\option\PollOption';
+ protected $className = PollOption::class;
/**
* option object type name
<?php
namespace wcf\system\importer;
+use wcf\data\user\object\watch\UserObjectWatch;
use wcf\data\user\object\watch\UserObjectWatchEditor;
use wcf\system\database\DatabaseException;
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\user\object\watch';
+ protected $className = UserObjectWatch::class;
/**
* object type id for watched objects
<?php
namespace wcf\system\importer;
+use wcf\data\label\group\LabelGroup;
use wcf\data\label\group\LabelGroupEditor;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\label\group\LabelGroup';
+ protected $className = LabelGroup::class;
/**
* @inheritDoc
<?php
namespace wcf\system\importer;
+use wcf\data\label\Label;
use wcf\data\label\LabelEditor;
/**
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\label\Label';
+ protected $className = Label::class;
/**
* @inheritDoc
<?php
namespace wcf\system\importer;
+use wcf\data\smiley\Smiley;
use wcf\data\smiley\SmileyEditor;
use wcf\system\WCF;
use wcf\util\StringUtil;
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\smiley\Smiley';
+ protected $className = Smiley::class;
/**
* known smiley codes
- *
* @var string[]
*/
public $knownCodes = [];
<?php
namespace wcf\system\importer;
+use wcf\data\user\avatar\UserAvatar;
use wcf\data\user\avatar\UserAvatarAction;
use wcf\data\user\avatar\UserAvatarEditor;
use wcf\system\exception\SystemException;
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\user\avatar\UserAvatar';
+ protected $className = UserAvatar::class;
/**
* @inheritDoc
<?php
namespace wcf\system\importer;
+use wcf\data\user\follow\UserFollow;
use wcf\system\WCF;
/**
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\user\follow\UserFollow';
+ protected $className = UserFollow::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\user\group\UserGroup';
+ protected $className = UserGroup::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\user\User';
+ protected $className = User::class;
/**
* ids of default notification events
namespace wcf\system\importer;
use wcf\data\user\option\category\UserOptionCategoryEditor;
use wcf\data\user\option\category\UserOptionCategoryList;
+use wcf\data\user\option\UserOption;
use wcf\data\user\option\UserOptionAction;
use wcf\data\user\option\UserOptionEditor;
use wcf\system\language\LanguageFactory;
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\user\option\UserOption';
+ protected $className = UserOption::class;
/**
* language category id
<?php
namespace wcf\system\importer;
use wcf\data\user\group\UserGroup;
+use wcf\data\user\rank\UserRank;
use wcf\data\user\rank\UserRankEditor;
/**
/**
* @inheritDoc
*/
- protected $className = 'wcf\data\user\rank\UserRank';
+ protected $className = UserRank::class;
/**
* @inheritDoc
<?php
namespace wcf\system\label;
+use wcf\data\label\group\LabelGroup;
use wcf\data\label\group\ViewableLabelGroup;
use wcf\data\object\type\ObjectTypeCache;
use wcf\system\cache\builder\LabelCacheBuilder;
$data[$groupID] = $this->labelGroups['groups'][$groupID];
}
- uasort($data, ['\wcf\data\label\group\LabelGroup', 'sortLabelGroups']);
+ uasort($data, [LabelGroup::class, 'sortLabelGroups']);
return $data;
}
<?php
namespace wcf\system\label\object;
+use wcf\data\label\group\LabelGroup;
use wcf\data\label\group\ViewableLabelGroup;
use wcf\system\exception\SystemException;
use wcf\system\label\LabelHandler;
$data[$groupID] = $this->labelGroups[$groupID];
}
- uasort($data, ['\wcf\data\label\group\LabelGroup', 'sortLabelGroups']);
+ uasort($data, [LabelGroup::class, 'sortLabelGroups']);
return $data;
}
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;
$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);
}
// 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();
}
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;
* @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");
}
<?php
namespace wcf\system\option;
+use wcf\data\category\CategoryNodeTree;
use wcf\data\option\Option;
use wcf\system\category\CategoryHandler;
use wcf\system\exception\UserInputException;
* node tree class
* @var string
*/
- public $nodeTreeClassname = 'wcf\data\category\CategoryNodeTree';
+ public $nodeTreeClassname = CategoryNodeTree::class;
/**
* @inheritDoc
if ($option->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)) {
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;
* cache class name
* @var string
*/
- protected $cacheClass = 'wcf\system\cache\builder\OptionCacheBuilder';
+ protected $cacheClass = OptionCacheBuilder::class;
/**
* list of all option categories
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;
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;
/**
* @inheritDoc
*/
- protected $cacheClass = 'wcf\system\cache\builder\UserOptionCacheBuilder';
+ protected $cacheClass = UserOptionCacheBuilder::class;
/**
* true if within registration process
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;
/**
* @inheritDoc
*/
- protected $cacheClass = 'wcf\system\cache\builder\UserGroupOptionCacheBuilder';
+ protected $cacheClass = UserGroupOptionCacheBuilder::class;
/**
* user group object
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;
// 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);
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');
$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
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, '<=')) {
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);
}
// 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);
}
// sort by version number
- usort($versions, ['wcf\data\package\Package', 'compareVersion']);
+ usort($versions, [Package::class, 'compareVersion']);
// take newest (last)
return array_pop($versions);
<?php
namespace wcf\system\package\plugin;
+use wcf\data\acl\option\ACLOptionEditor;
use wcf\system\exception\SystemException;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- public $className = 'wcf\data\acl\option\ACLOptionEditor';
+ public $className = ACLOptionEditor::class;
/**
* list of loaded acl object type ids sorted by their option type name
<?php
namespace wcf\system\package\plugin;
+use wcf\data\acp\menu\item\ACPMenuItemEditor;
/**
* Installs, updates and deletes ACP menu items.
/**
* @inheritDoc
*/
- public $className = 'wcf\data\acp\menu\item\ACPMenuItemEditor';
+ public $className = ACPMenuItemEditor::class;
/**
* @inheritDoc
<?php
namespace wcf\system\package\plugin;
+use wcf\data\acp\search\provider\ACPSearchProviderEditor;
use wcf\system\cache\builder\ACPSearchProviderCacheBuilder;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- public $className = 'wcf\data\acp\search\provider\ACPSearchProviderEditor';
+ public $className = ACPSearchProviderEditor::class;
/**
* @inheritDoc
<?php
namespace wcf\system\package\plugin;
+use wcf\data\clipboard\action\ClipboardActionEditor;
use wcf\system\WCF;
/**
/**
* @inheritDoc
*/
- public $className = 'wcf\data\clipboard\action\ClipboardActionEditor';
+ public $className = ClipboardActionEditor::class;
/**
* list of pages per action id
<?php
namespace wcf\system\package\plugin;
+use wcf\data\core\object\CoreObjectEditor;
use wcf\system\cache\builder\CoreObjectCacheBuilder;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- public $className = 'wcf\data\core\object\CoreObjectEditor';
+ public $className = CoreObjectEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- public $className = 'wcf\data\cronjob\CronjobEditor';
+ public $className = CronjobEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- public $className = 'wcf\data\event\listener\EventListenerEditor';
+ public $className = EventListenerEditor::class;
/**
* @inheritDoc
<?php
namespace wcf\system\package\plugin;
+use wcf\data\object\type\definition\ObjectTypeDefinitionEditor;
use wcf\system\WCF;
/**
/**
* @inheritDoc
*/
- public $className = 'wcf\data\object\type\definition\ObjectTypeDefinitionEditor';
+ public $className = ObjectTypeDefinitionEditor::class;
/**
* @inheritDoc
<?php
namespace wcf\system\package\plugin;
+use wcf\data\object\type\ObjectTypeEditor;
use wcf\system\exception\SystemException;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- public $className = 'wcf\data\object\type\ObjectTypeEditor';
+ public $className = ObjectTypeEditor::class;
/**
* @inheritDoc
<?php
namespace wcf\system\package\plugin;
+use wcf\data\package\installation\plugin\PackageInstallationPluginEditor;
use wcf\system\WCF;
/**
/**
* @inheritDoc
*/
- public $className = 'wcf\data\package\installation\plugin\PackageInstallationPluginEditor';
+ public $className = PackageInstallationPluginEditor::class;
/**
* @inheritDoc
<?php
namespace wcf\system\package\plugin;
+use wcf\data\sitemap\SitemapEditor;
use wcf\system\cache\builder\SitemapCacheBuilder;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- public $className = 'wcf\data\sitemap\SitemapEditor';
+ public $className = SitemapEditor::class;
/**
* @inheritDoc
<?php
namespace wcf\system\package\plugin;
+use wcf\data\smiley\SmileyEditor;
use wcf\system\WCF;
/**
/**
* @inheritDoc
*/
- public $className = 'wcf\data\smiley\SmileyEditor';
+ public $className = SmileyEditor::class;
/**
* @inheritDoc
/**
* @inheritDoc
*/
- public $className = 'wcf\data\style\StyleEditor';
+ public $className = StyleEditor::class;
/**
* @inheritDoc
<?php
namespace wcf\system\package\plugin;
+use wcf\data\template\listener\TemplateListenerEditor;
use wcf\system\cache\builder\TemplateListenerCodeCacheBuilder;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- public $className = 'wcf\data\template\listener\TemplateListenerEditor';
+ public $className = TemplateListenerEditor::class;
/**
* @inheritDoc
<?php
namespace wcf\system\package\plugin;
+use wcf\data\user\menu\item\UserMenuItemEditor;
/**
* Installs, updates and deletes user menu items.
/**
* @inheritDoc
*/
- public $className = 'wcf\data\user\menu\item\UserMenuItemEditor';
+ public $className = UserMenuItemEditor::class;
/**
* @inheritDoc
<?php
namespace wcf\system\package\plugin;
+use wcf\data\user\notification\event\UserNotificationEventEditor;
use wcf\system\exception\SystemException;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- public $className = 'wcf\data\user\notification\event\UserNotificationEventEditor';
+ public $className = UserNotificationEventEditor::class;
/**
* @inheritDoc
<?php
namespace wcf\system\package\plugin;
+use wcf\data\user\profile\menu\item\UserProfileMenuItemEditor;
use wcf\system\WCF;
/**
/**
* @inheritDoc
*/
- public $className = 'wcf\data\user\profile\menu\item\UserProfileMenuItemEditor';
+ public $className = UserProfileMenuItemEditor::class;
/**
* @inheritDoc
WHERE package = ?";
$statement = WCF::getDB()->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,
// 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']);
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;
/**
$className = '';
}
}
-
+
// fallback to MySQL
if (empty($className)) {
- $className = 'wcf\system\search\mysql\MysqlSearchEngine';
+ $className = MysqlSearchEngine::class;
}
-
+
$this->searchEngine = call_user_func([$className, 'getInstance']);
}
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;
/**
// fallback to MySQL
if (empty($className)) {
- $className = 'wcf\system\search\mysql\MysqlSearchIndexManager';
+ $className = MysqlSearchIndexManager::class;
}
$this->searchIndexManager = call_user_func([$className, 'getInstance']);
<?php
namespace wcf\system\search;
+use wcf\data\search\keyword\SearchKeyword;
use wcf\data\search\keyword\SearchKeywordAction;
use wcf\system\SingletonFactory;
use wcf\system\WCF;
WHERE keyword = ?";
$statement = WCF::getDB()->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
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();
<?php
namespace wcf\system\search\acp;
use wcf\data\DatabaseObject;
+use wcf\data\DatabaseObjectList;
use wcf\system\exception\SystemException;
/**
*/
protected function loadCategories() {
// validate list class name
- if (empty($this->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");
}
<?php
namespace wcf\system\search\acp;
+use wcf\data\acp\menu\item\ACPMenuItem;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\menu\acp\ACPMenu;
use wcf\system\WCF;
$statement->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])) {
<?php
namespace wcf\system\search\acp;
+use wcf\data\option\category\OptionCategoryList;
+use wcf\data\option\Option;
use wcf\system\cache\builder\OptionCacheBuilder;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\request\LinkHandler;
/**
* @inheritDoc
*/
- protected $listClassName = 'wcf\data\option\category\OptionCategoryList';
+ protected $listClassName = OptionCategoryList::class;
/**
* @inheritDoc
$optionCategories = OptionCacheBuilder::getInstance()->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;
<?php
namespace wcf\system\search\acp;
+use wcf\data\package\Package;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
'%'.$query.'%'
], $conditions->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()
<?php
namespace wcf\system\search\acp;
use wcf\data\user\group\UserGroup;
+use wcf\data\user\User;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
$statement = WCF::getDB()->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
<?php
namespace wcf\system\search\acp;
+use wcf\data\user\group\option\category\UserGroupOptionCategoryList;
+use wcf\data\user\group\option\UserGroupOption;
use wcf\system\cache\builder\UserGroupOptionCacheBuilder;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\request\LinkHandler;
/**
* @inheritDoc
*/
- protected $listClassName = 'wcf\data\user\group\option\category\UserGroupOptionCategoryList';
+ protected $listClassName = UserGroupOptionCategoryList::class;
/**
* @inheritDoc
$optionCategories = UserGroupOptionCacheBuilder::getInstance()->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;
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;
*/
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) {
$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] = [];
}
/**
* @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));
/**
* @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;
* @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;
* @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.
* @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);
}
* user authentication class name
* @var string
*/
- public $className = 'wcf\system\user\authentication\DefaultUserAuthentication';
+ public $className = DefaultUserAuthentication::class;
/**
* user authentication instance
// 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']);
$statement->execute($conditions->getParameters());
$notifications = [];
- while ($notification = $statement->fetchObject('\wcf\data\user\notification\UserNotification')) {
+ while ($notification = $statement->fetchObject(UserNotification::class)) {
$notifications[$notification->notificationID] = $notification;
}
<?php
namespace wcf\system\user\notification\object\type;
+use wcf\data\like\Like;
+use wcf\data\like\LikeList;
+use wcf\system\user\notification\object\LikeUserNotificationObject;
/**
* User notification object type implementation for likes.
/**
* @inheritDoc
*/
- protected static $decoratorClassName = 'wcf\system\user\notification\object\LikeUserNotificationObject';
+ protected static $decoratorClassName = LikeUserNotificationObject::class;
/**
* @inheritDoc
*/
- protected static $objectClassName = 'wcf\data\like\Like';
+ protected static $objectClassName = Like::class;
/**
* @inheritDoc
*/
- protected static $objectListClassName = 'wcf\data\like\LikeList';
+ protected static $objectListClassName = LikeList::class;
}
<?php
namespace wcf\system\user\notification\object\type;
+use wcf\data\user\follow\UserFollow;
+use wcf\data\user\follow\UserFollowList;
+use wcf\system\user\notification\object\UserFollowUserNotificationObject;
/**
* Represents a following user as a notification object type.
/**
* @inheritDoc
*/
- protected static $decoratorClassName = 'wcf\system\user\notification\object\UserFollowUserNotificationObject';
+ protected static $decoratorClassName = UserFollowUserNotificationObject::class;
/**
* @inheritDoc
*/
- protected static $objectClassName = 'wcf\data\user\follow\UserFollow';
+ protected static $objectClassName = UserFollow::class;
/**
* @inheritDoc
*/
- protected static $objectListClassName = 'wcf\data\user\follow\UserFollowList';
+ protected static $objectListClassName = UserFollowList::class;
}
<?php
namespace wcf\system\user\notification\object\type;
+use wcf\data\comment\response\CommentResponse;
+use wcf\data\comment\response\CommentResponseList;
+use wcf\system\user\notification\object\CommentResponseUserNotificationObject;
/**
* Represents a comment response notification object type.
/**
* @inheritDoc
*/
- protected static $decoratorClassName = 'wcf\system\user\notification\object\CommentResponseUserNotificationObject';
+ protected static $decoratorClassName = CommentResponseUserNotificationObject::class;
/**
* @inheritDoc
*/
- protected static $objectClassName = 'wcf\data\comment\response\CommentResponse';
+ protected static $objectClassName = CommentResponse::class;
/**
* @inheritDoc
*/
- protected static $objectListClassName = 'wcf\data\comment\response\CommentResponseList';
+ protected static $objectListClassName = CommentResponseList::class;
}
<?php
namespace wcf\system\user\notification\object\type;
+use wcf\data\comment\Comment;
+use wcf\data\comment\CommentList;
+use wcf\system\user\notification\object\CommentUserNotificationObject;
use wcf\system\WCF;
/**
/**
* @inheritDoc
*/
- protected static $decoratorClassName = 'wcf\system\user\notification\object\CommentUserNotificationObject';
+ protected static $decoratorClassName = CommentUserNotificationObject::class;
/**
* @inheritDoc
*/
- protected static $objectClassName = 'wcf\data\comment\Comment';
+ protected static $objectClassName = Comment::class;
/**
* @inheritDoc
*/
- protected static $objectListClassName = 'wcf\data\comment\CommentList';
+ protected static $objectListClassName = CommentList::class;
/**
* @inheritDoc
<?php
namespace wcf\system\worker;
+use wcf\data\DatabaseObjectList;
use wcf\system\event\EventHandler;
use wcf\system\exception\SystemException;
use wcf\system\request\LinkHandler;
throw new SystemException('DatabaseObjectList class name not specified.');
}
- if (!is_subclass_of($this->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();
<?php
namespace wcf\system\worker;
use wcf\data\attachment\AttachmentAction;
+use wcf\data\attachment\AttachmentList;
use wcf\system\exception\SystemException;
/**
/**
* @inheritDoc
*/
- protected $objectListClassName = 'wcf\data\attachment\AttachmentList';
+ protected $objectListClassName = AttachmentList::class;
/**
* @inheritDoc
<?php
namespace wcf\system\worker;
use wcf\data\like\Like;
+use wcf\data\like\LikeList;
use wcf\system\user\activity\point\UserActivityPointHandler;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- protected $objectListClassName = 'wcf\data\like\LikeList';
+ protected $objectListClassName = LikeList::class;
/**
* @inheritDoc
<?php
namespace wcf\system\worker;
+use wcf\data\like\object\LikeObjectList;
use wcf\data\like\Like;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\WCF;
/**
* @inheritDoc
*/
- protected $objectListClassName = 'wcf\data\like\object\LikeObjectList';
+ protected $objectListClassName = LikeObjectList::class;
/**
* @inheritDoc
*/
public function execute() {
$userList = new UserList();
- $userList->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;
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;
/**
* @inheritDoc
*/
- protected $objectListClassName = 'wcf\data\user\UserList';
+ protected $objectListClassName = UserList::class;
/**
* @inheritDoc
@header('X-Frame-Options: SAMEORIGIN');
}
- ob_start(['wcf\util\HeaderUtil', 'parseOutput']);
+ ob_start([self::class, 'parseOutput']);
}
/**
// 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) {