From 13b11e4c70585510ecf147983a69955fe4590ef9 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 10 May 2021 15:50:37 +0200 Subject: [PATCH] Remove unused local variables --- .../lib/acp/form/ApplicationManagementForm.class.php | 2 +- .../files/lib/acp/form/LabelGroupAddForm.class.php | 2 +- .../files/lib/acp/form/LabelGroupEditForm.class.php | 2 +- .../lib/acp/form/NotificationPresetSettingsForm.class.php | 2 +- .../install/files/lib/acp/page/UserListPage.class.php | 2 +- .../files/lib/data/cronjob/CronjobAction.class.php | 2 +- .../install/files/lib/data/option/OptionAction.class.php | 2 +- .../lib/data/package/update/PackageUpdateAction.class.php | 8 ++++---- wcfsetup/install/files/lib/form/RegisterForm.class.php | 1 - wcfsetup/install/files/lib/system/WCFSetup.class.php | 2 +- .../files/lib/system/bbcode/HtmlBBCodeParser.class.php | 2 +- .../builder/TemplateListenerCodeCacheBuilder.class.php | 2 +- .../builder/UserGroupPermissionCacheBuilder.class.php | 2 +- .../files/lib/system/comment/CommentHandler.class.php | 6 +++--- .../system/condition/AbstractSelectCondition.class.php | 2 +- .../files/lib/system/devtools/pip/DevtoolsPip.class.php | 4 ++-- .../form/builder/field/TSelectionFormField.class.php | 2 +- .../html/input/node/HtmlInputNodeProcessor.class.php | 1 - .../node/HtmlInputNodeWoltlabMetacodeMarker.class.php | 2 +- .../system/message/quote/MessageQuoteManager.class.php | 2 +- .../files/lib/system/package/FilesFileHandler.class.php | 2 +- .../package/PackageInstallationDispatcher.class.php | 2 +- .../package/PackageInstallationNodeBuilder.class.php | 2 +- .../system/package/PackageInstallationScheduler.class.php | 2 +- .../lib/system/package/PackageUpdateDispatcher.class.php | 2 +- .../plugin/PagePackageInstallationPlugin.class.php | 2 +- .../files/lib/system/request/LinkHandler.class.php | 2 +- .../lib/system/search/SearchResultTextParser.class.php | 2 +- .../files/lib/system/style/StyleCompiler.class.php | 2 -- wcfsetup/install/files/lib/util/FileUtil.class.php | 2 +- wcfsetup/install/files/lib/util/HTTPRequest.class.php | 2 +- 31 files changed, 34 insertions(+), 38 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/form/ApplicationManagementForm.class.php b/wcfsetup/install/files/lib/acp/form/ApplicationManagementForm.class.php index f9c8e0a520..01180e0a84 100644 --- a/wcfsetup/install/files/lib/acp/form/ApplicationManagementForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/ApplicationManagementForm.class.php @@ -129,7 +129,7 @@ final class ApplicationManagementForm extends AbstractForm } } - foreach ($this->landingPageID as $packageID => $landingPageID) { + foreach ($this->landingPageID as $landingPageID) { if (!$landingPageID) { continue; } diff --git a/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php b/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php index ce9abbddfb..dc56be2275 100644 --- a/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php @@ -208,7 +208,7 @@ class LabelGroupAddForm extends AbstractForm // save object type relations $this->saveObjectTypeRelations($returnValues['returnValues']->groupID); - foreach ($this->labelObjectTypes as $objectTypeID => $labelObjectType) { + foreach ($this->labelObjectTypes as $labelObjectType) { $labelObjectType->save(); } diff --git a/wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php b/wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php index b907a3eab8..e7f278fbb1 100644 --- a/wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php @@ -95,7 +95,7 @@ class LabelGroupEditForm extends LabelGroupAddForm // update object type relations $this->saveObjectTypeRelations($this->groupID); - foreach ($this->labelObjectTypes as $objectTypeID => $labelObjectType) { + foreach ($this->labelObjectTypes as $labelObjectType) { $labelObjectType->save(); } diff --git a/wcfsetup/install/files/lib/acp/form/NotificationPresetSettingsForm.class.php b/wcfsetup/install/files/lib/acp/form/NotificationPresetSettingsForm.class.php index d1bc76cfcd..dbf2770516 100644 --- a/wcfsetup/install/files/lib/acp/form/NotificationPresetSettingsForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/NotificationPresetSettingsForm.class.php @@ -184,7 +184,7 @@ class NotificationPresetSettingsForm extends AbstractForm { parent::save(); - foreach ($this->events as $objectType => $events) { + foreach ($this->events as $events) { foreach ($events as $event) { $preset = 0; $presetMailNotificationType = 'none'; diff --git a/wcfsetup/install/files/lib/acp/page/UserListPage.class.php b/wcfsetup/install/files/lib/acp/page/UserListPage.class.php index 0592ee4892..2fef97bcab 100755 --- a/wcfsetup/install/files/lib/acp/page/UserListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/UserListPage.class.php @@ -313,7 +313,7 @@ class UserListPage extends SortablePage } // get special columns - foreach ($this->users as $key => $user) { + foreach ($this->users as $user) { foreach ($this->columns as $column) { switch ($column) { case 'email': diff --git a/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php b/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php index 00a316f1f7..fdc3e6678c 100644 --- a/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php +++ b/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php @@ -122,7 +122,7 @@ class CronjobAction extends AbstractDatabaseObjectAction implements IToggleActio WCF::getSession()->disableUpdate(); try { - foreach ($this->getObjects() as $key => $cronjob) { + foreach ($this->getObjects() as $cronjob) { // mark them as pending $cronjob->update(['state' => Cronjob::PENDING]); } diff --git a/wcfsetup/install/files/lib/data/option/OptionAction.class.php b/wcfsetup/install/files/lib/data/option/OptionAction.class.php index 661dd51d38..8a48a9e17d 100644 --- a/wcfsetup/install/files/lib/data/option/OptionAction.class.php +++ b/wcfsetup/install/files/lib/data/option/OptionAction.class.php @@ -189,7 +189,7 @@ class OptionAction extends AbstractDatabaseObjectAction foreach ($dirs as $dir => $domainPaths) { \krsort($domainPaths); - foreach ($domainPaths as $domainPath => $value) { + foreach ($domainPaths as $value) { $htaccess = "{$dir}.htaccess"; $path = FileUtil::addTrailingSlash(\substr($value, \strlen($dir))); if ($path == '/') { 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 9d1bd4d3eb..ba28c61787 100644 --- a/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php +++ b/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php @@ -203,7 +203,7 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction // remove duplicates when there are both versions from trusted and untrusted servers foreach ($possiblePackages as $identifier => $packageSources) { $hasTrustedSource = false; - foreach ($packageSources as $packageUpdateID => $packageUpdateServerID) { + foreach ($packageSources as $packageUpdateServerID) { if (\in_array($packageUpdateServerID, $trustedServerIDs)) { $hasTrustedSource = true; break; @@ -222,7 +222,7 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction // Sort by the highest version and return all other sources for the same package. $validPackageUpdateIDs = []; - foreach ($possiblePackages as $identifier => $packageSources) { + foreach ($possiblePackages as $packageSources) { if (\count($packageSources) > 1) { $packageUpdateVersionIDs = []; foreach (\array_keys($packageSources) as $packageUpdateID) { @@ -395,7 +395,7 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction // determine highest versions $packageUpdates = []; - foreach ($packageVersions as $package => $versionData) { + foreach ($packageVersions as $versionData) { $accessible = $existing = $versions = []; foreach ($versionData as $packageUpdateID => $versionTypes) { @@ -550,7 +550,7 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction * @var int $packageUpdateID * @var ViewablePackageUpdate $packageUpdate */ - foreach ($packageUpdates as $packageUpdateID => $packageUpdate) { + foreach ($packageUpdates as $packageUpdate) { $versionIDs = $updateData[$packageUpdate->packageUpdateID]; $packageUpdate->setAccessibleVersion($updateVersions[$versionIDs['accessible']]); $packageUpdate->setLatestVersion($updateVersions[$versionIDs['existing']]); diff --git a/wcfsetup/install/files/lib/form/RegisterForm.class.php b/wcfsetup/install/files/lib/form/RegisterForm.class.php index f339920f50..69bea557ab 100644 --- a/wcfsetup/install/files/lib/form/RegisterForm.class.php +++ b/wcfsetup/install/files/lib/form/RegisterForm.class.php @@ -452,7 +452,6 @@ class RegisterForm extends UserAddForm $result = $this->objectAction->executeAction(); /** @var User $user */ $user = $result['returnValues']; - $userEditor = new UserEditor($user); // update session WCF::getSession()->changeUser($user); diff --git a/wcfsetup/install/files/lib/system/WCFSetup.class.php b/wcfsetup/install/files/lib/system/WCFSetup.class.php index 5aaafda3fe..5d6bc90e76 100644 --- a/wcfsetup/install/files/lib/system/WCFSetup.class.php +++ b/wcfsetup/install/files/lib/system/WCFSetup.class.php @@ -199,7 +199,7 @@ class WCFSetup extends WCF */ protected static function getAvailableLanguages() { - $languages = $match = []; + $languages = []; foreach (\glob(TMP_DIR . 'setup/lang/*.xml') as $file) { $xml = new XML(); $xml->load($file); diff --git a/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php b/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php index 7289e84dab..02d864eec5 100644 --- a/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php @@ -482,7 +482,7 @@ class HtmlBBCodeParser extends BBCodeParser return $tag['source']; } - $index = (isset($tag['bufferPlaceholder'])) ? $index = $tag['bufferPlaceholder'] : \count($this->openTagIdentifiers); + $index = (isset($tag['bufferPlaceholder'])) ? $tag['bufferPlaceholder'] : \count($this->openTagIdentifiers); $uuid = StringUtil::getUUID(); $this->openTagIdentifiers[$index] = [ diff --git a/wcfsetup/install/files/lib/system/cache/builder/TemplateListenerCodeCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/TemplateListenerCodeCacheBuilder.class.php index 20b03b9710..6fc42e2b6f 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/TemplateListenerCodeCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/TemplateListenerCodeCacheBuilder.class.php @@ -40,7 +40,7 @@ class TemplateListenerCodeCacheBuilder extends AbstractCacheBuilder if ($templateListener->options || $templateListener->permissions) { $templateCode = '{if '; - $options = $permissions = []; + $options = []; if ($templateListener->options) { $options = \explode(',', \strtoupper($templateListener->options)); diff --git a/wcfsetup/install/files/lib/system/cache/builder/UserGroupPermissionCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/UserGroupPermissionCacheBuilder.class.php index 02db02e7b0..80d91ca3c3 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/UserGroupPermissionCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/UserGroupPermissionCacheBuilder.class.php @@ -69,7 +69,7 @@ class UserGroupPermissionCacheBuilder extends AbstractCacheBuilder $optionData[$row['groupID']][$row['optionName']] = $row; } - foreach ($optionData as $groupID => $options) { + foreach ($optionData as $options) { $optionBlacklist = []; foreach ($options as $option) { diff --git a/wcfsetup/install/files/lib/system/comment/CommentHandler.class.php b/wcfsetup/install/files/lib/system/comment/CommentHandler.class.php index 8d62ed74a2..288c63280b 100644 --- a/wcfsetup/install/files/lib/system/comment/CommentHandler.class.php +++ b/wcfsetup/install/files/lib/system/comment/CommentHandler.class.php @@ -493,7 +493,7 @@ class CommentHandler extends SingletonFactory } if (!empty($commentEvents)) { - foreach ($commentEvents as $eventID => $eventData) { + foreach ($commentEvents as $eventData) { UserNotificationHandler::getInstance()->markAsConfirmed( $eventData['eventName'], $eventData['objectType'], @@ -572,7 +572,7 @@ class CommentHandler extends SingletonFactory } if (!empty($responseEvents)) { - foreach ($responseEvents as $eventID => $eventData) { + foreach ($responseEvents as $eventData) { UserNotificationHandler::getInstance()->markAsConfirmed( $eventData['eventName'], $eventData['objectType'], @@ -672,7 +672,7 @@ class CommentHandler extends SingletonFactory } if (!empty($responseEvents)) { - foreach ($responseEvents as $eventID => $eventData) { + foreach ($responseEvents as $eventData) { UserNotificationHandler::getInstance()->markAsConfirmed( $eventData['eventName'], $eventData['objectType'], diff --git a/wcfsetup/install/files/lib/system/condition/AbstractSelectCondition.class.php b/wcfsetup/install/files/lib/system/condition/AbstractSelectCondition.class.php index c358662aa3..c92cffae6e 100644 --- a/wcfsetup/install/files/lib/system/condition/AbstractSelectCondition.class.php +++ b/wcfsetup/install/files/lib/system/condition/AbstractSelectCondition.class.php @@ -149,7 +149,7 @@ abstract class AbstractSelectCondition extends AbstractSingleFieldCondition $options = $this->getOptions(); if (!isset($options[$this->fieldValue])) { - foreach ($options as $key => $value) { + foreach ($options as $value) { if (\is_array($value) && isset($value[$this->fieldValue])) { return; } diff --git a/wcfsetup/install/files/lib/system/devtools/pip/DevtoolsPip.class.php b/wcfsetup/install/files/lib/system/devtools/pip/DevtoolsPip.class.php index da8f2c4dab..a1a0bd3b29 100644 --- a/wcfsetup/install/files/lib/system/devtools/pip/DevtoolsPip.class.php +++ b/wcfsetup/install/files/lib/system/devtools/pip/DevtoolsPip.class.php @@ -331,7 +331,7 @@ class DevtoolsPip extends DatabaseObjectDecorator }); $iterator = new \RecursiveIteratorIterator($filter, \RecursiveIteratorIterator::SELF_FIRST); - foreach ($iterator as $value => $item) { + foreach ($iterator as $item) { /** @var \SplFileInfo $item */ $itemPath = $item->getRealPath(); if (\is_dir($itemPath)) { @@ -410,7 +410,7 @@ class DevtoolsPip extends DatabaseObjectDecorator }); $iterator = new \RecursiveIteratorIterator($filter, \RecursiveIteratorIterator::SELF_FIRST); - foreach ($iterator as $value => $item) { + foreach ($iterator as $item) { /** @var \SplFileInfo $item */ $itemPath = $item->getRealPath(); if (\is_dir($itemPath)) { diff --git a/wcfsetup/install/files/lib/system/form/builder/field/TSelectionFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/TSelectionFormField.class.php index 6b54b6ca03..07a7276ca0 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/TSelectionFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/TSelectionFormField.class.php @@ -139,7 +139,7 @@ trait TSelectionFormField if ($nestedOptions) { $collectedOptions = []; - foreach ($options as $key => $object) { + foreach ($options as $object) { if (!($object instanceof IObjectTreeNode)) { throw new \InvalidArgumentException( "Nested traversable options must implement '" . IObjectTreeNode::class . "'." diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php index e7ac9b3169..14c910f22f 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php @@ -540,7 +540,6 @@ class HtmlInputNodeProcessor extends AbstractHtmlNodeProcessor } if (!empty($inlineStyles)) { - $styles = []; /** @var \DOMElement $element */ foreach ($this->getXPath()->query('//*[@style]') as $element) { $tmp = \array_filter(\explode(';', $element->getAttribute('style'))); diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php index f91c128c69..4c77a59750 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacodeMarker.class.php @@ -253,7 +253,7 @@ class HtmlInputNodeWoltlabMetacodeMarker extends AbstractHtmlInputNode protected function groupPairsByName(array $pairs) { $groups = []; - foreach ($pairs as $uuid => $data) { + foreach ($pairs as $data) { $name = $data['name']; if (!isset($groups[$name])) { diff --git a/wcfsetup/install/files/lib/system/message/quote/MessageQuoteManager.class.php b/wcfsetup/install/files/lib/system/message/quote/MessageQuoteManager.class.php index b1523403dc..cbb4201836 100644 --- a/wcfsetup/install/files/lib/system/message/quote/MessageQuoteManager.class.php +++ b/wcfsetup/install/files/lib/system/message/quote/MessageQuoteManager.class.php @@ -521,7 +521,7 @@ class MessageQuoteManager extends SingletonFactory $objectIDs[$objectType] = []; if (isset($this->quotes[$objectType])) { foreach ($this->quotes[$objectType] as $objectID => $quotes) { - foreach ($quotes as $quoteID => $isFullQuote) { + foreach ($quotes as $isFullQuote) { if ($isFullQuote) { $objectIDs[$objectType][] = $objectID; break; diff --git a/wcfsetup/install/files/lib/system/package/FilesFileHandler.class.php b/wcfsetup/install/files/lib/system/package/FilesFileHandler.class.php index f21b85d660..2133591bd0 100644 --- a/wcfsetup/install/files/lib/system/package/FilesFileHandler.class.php +++ b/wcfsetup/install/files/lib/system/package/FilesFileHandler.class.php @@ -40,7 +40,7 @@ class FilesFileHandler extends PackageInstallationFileHandler // check delivered files if (!empty($lockedFiles)) { - foreach ($files as $key => $file) { + foreach ($files as $file) { if (isset($lockedFiles[$file])) { $owningPackage = new Package($lockedFiles[$file]); diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php index 1fcc166f74..edb123972f 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php @@ -606,7 +606,7 @@ class PackageInstallationDispatcher VALUES (?, ?)"; $statement = WCF::getDB()->prepareStatement($sql); - foreach ($requirements as $identifier => $possibleRequirements) { + foreach ($requirements as $possibleRequirements) { $requirement = \array_shift($possibleRequirements); $statement->execute([ diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php index 8ddd35d255..833326405b 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php @@ -645,7 +645,7 @@ class PackageInstallationNodeBuilder VALUES (?, ?, ?, ?, ?, ?, ?)"; $statement = WCF::getDB()->prepareStatement($sql); - foreach ($pluginNodes as $index => $nodeData) { + foreach ($pluginNodes as $nodeData) { $statement->execute([ $this->installation->queue->queueID, $this->installation->queue->processNo, diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php index b4fd2af82d..fd177776b9 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php @@ -450,7 +450,7 @@ class PackageInstallationScheduler $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); while ($row = $statement->fetchArray()) { - foreach ($packageInstallations as $key => $packageInstallation) { + foreach ($packageInstallations as $packageInstallation) { if ($packageInstallation['package'] == $row['excludedPackage']) { if (!empty($row['excludedPackageVersion'])) { // check version diff --git a/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php index e52383e958..bf1e454cfc 100644 --- a/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php @@ -841,7 +841,7 @@ class PackageUpdateDispatcher extends SingletonFactory // remove requirements of application packages if ($removeRequirements) { - foreach ($existingPackages as $identifier => $instances) { + foreach ($existingPackages as $instances) { foreach ($instances as $instance) { if ($instance['isApplication'] && isset($updates[$instance['packageID']])) { $updates = $this->removeUpdateRequirements( diff --git a/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php index 77abb43879..76d6050df7 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php @@ -401,7 +401,7 @@ class PagePackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin SearchIndexManager::getInstance()->createSearchIndices(); // update search index - foreach ($this->pages as $pageID => $page) { + foreach ($this->pages as $page) { if ($page->pageType == 'text' || $page->pageType == 'html') { foreach ($page->getPageContents() as $languageID => $pageContent) { SearchIndexManager::getInstance()->set( diff --git a/wcfsetup/install/files/lib/system/request/LinkHandler.class.php b/wcfsetup/install/files/lib/system/request/LinkHandler.class.php index 295c02cb87..dd6ca13080 100644 --- a/wcfsetup/install/files/lib/system/request/LinkHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/LinkHandler.class.php @@ -116,7 +116,7 @@ class LinkHandler extends SingletonFactory { $abbreviation = 'wcf'; $anchor = ''; - $isACP = $originIsACP = RequestHandler::getInstance()->isACPRequest(); + $isACP = RequestHandler::getInstance()->isACPRequest(); $isRaw = false; $encodeTitle = true; diff --git a/wcfsetup/install/files/lib/system/search/SearchResultTextParser.class.php b/wcfsetup/install/files/lib/system/search/SearchResultTextParser.class.php index 061f1991fe..d355d68623 100644 --- a/wcfsetup/install/files/lib/system/search/SearchResultTextParser.class.php +++ b/wcfsetup/install/files/lib/system/search/SearchResultTextParser.class.php @@ -142,7 +142,7 @@ class SearchResultTextParser extends SingletonFactory $newText = ''; $i = 0; $length = \count($matches); - foreach ($matches as $keyword => $position) { + foreach ($matches as $position) { if ($position['start'] < $start) { $position['end'] += $start - $position['start']; $position['start'] = $start; diff --git a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php index c1d925c213..cc236cc284 100644 --- a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php +++ b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php @@ -98,8 +98,6 @@ final class StyleCompiler extends SingletonFactory */ public static function getDefaultVariables() { - $variables = []; - $sql = "SELECT variable.variableName, variable.defaultValue FROM wcf" . WCF_N . "_style_variable variable ORDER BY variable.variableID ASC"; diff --git a/wcfsetup/install/files/lib/util/FileUtil.class.php b/wcfsetup/install/files/lib/util/FileUtil.class.php index 7fe477a814..05b8eab8ea 100644 --- a/wcfsetup/install/files/lib/util/FileUtil.class.php +++ b/wcfsetup/install/files/lib/util/FileUtil.class.php @@ -339,7 +339,7 @@ final class FileUtil $result[] = ''; } - foreach ($pathA as $key => $dir) { + foreach ($pathA as $dir) { if ($dir == '..') { if (\end($result) == '..') { $result[] = '..'; diff --git a/wcfsetup/install/files/lib/util/HTTPRequest.class.php b/wcfsetup/install/files/lib/util/HTTPRequest.class.php index 2b14b8e735..b4a1284de3 100644 --- a/wcfsetup/install/files/lib/util/HTTPRequest.class.php +++ b/wcfsetup/install/files/lib/util/HTTPRequest.class.php @@ -129,7 +129,7 @@ final class HTTPRequest new \RecursiveArrayIterator($this->postParameters), \RecursiveIteratorIterator::SELF_FIRST ); - foreach ($iterator as $k => $v) { + foreach ($iterator as $v) { /** @noinspection PhpUndefinedMethodInspection */ if (!$iterator->hasChildren()) { $key = ''; -- 2.20.1