Fix PHP codestyle
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 24 Jul 2023 13:34:46 +0000 (15:34 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 24 Jul 2023 13:34:46 +0000 (15:34 +0200)
19 files changed:
wcfsetup/install/files/acp/install_com.woltlab.wcf_step2.php
wcfsetup/install/files/lib/acp/form/DevtoolsProjectAddForm.class.php
wcfsetup/install/files/lib/acp/form/FirstTimeSetupLicenseForm.class.php
wcfsetup/install/files/lib/acp/form/LanguageAddForm.class.php
wcfsetup/install/files/lib/data/style/Style.class.php
wcfsetup/install/files/lib/data/user/rank/I18nUserRankList.class.php
wcfsetup/install/files/lib/system/bbcode/AttachmentBBCode.class.php
wcfsetup/install/files/lib/system/category/ArticleCategoryType.class.php
wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeImg.class.php
wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php
wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeProcessor.class.php
wcfsetup/install/files/lib/system/package/plugin/CronjobPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/search/SearchIndexManager.class.php
wcfsetup/install/files/lib/system/template/plugin/TimeFunctionTemplatePlugin.class.php
wcfsetup/install/files/lib/system/user/event/UsernameValidating.class.php
wcfsetup/install/files/lib/system/user/notification/event/AbstractCommentResponseUserNotificationEvent.class.php
wcfsetup/install/files/lib/system/user/notification/event/AbstractCommentUserNotificationEvent.class.php
wcfsetup/install/files/lib/util/DOMUtil.class.php
wcfsetup/install/files/lib/util/UserRegistrationUtil.class.php

index 0ddf46f2c7907b20e71c051c7e2573a1155afbf1..7f0455495b0795994b72f48197fb60c9bdb7923b 100644 (file)
@@ -8,7 +8,6 @@ use wcf\data\user\UserEditor;
 use wcf\data\user\UserProfileAction;
 use wcf\system\image\adapter\ImagickImageAdapter;
 use wcf\system\WCF;
-use wcf\util\StringUtil;
 
 // set default landing page
 $sql = "UPDATE  wcf1_application
index e20eac90c384795e1b64cde8744c3f3bfe6534c7..fee232bc534bfac39f6f4062fa71a97cb748a2d4 100644 (file)
@@ -232,7 +232,7 @@ class DevtoolsProjectAddForm extends AbstractFormBuilderForm
                     })),
                 TemplateFormNode::create('pathPasteHelper')
                     ->application('wcf')
-                    ->templateName('__devtoolsProjectPathPasteHelper')
+                    ->templateName('__devtoolsProjectPathPasteHelper'),
             ]);
         $dataTab->appendChild($dataContainer);
 
index facfe5c643bbdd1751abea56e17c76b5fd64d6b6..dc566a5508c859c749fdf1d205b1c3b3c421d35a 100644 (file)
@@ -129,6 +129,7 @@ final class FirstTimeSetupLicenseForm extends AbstractFormBuilderForm
         );
 
         $response = HttpFactory::makeClientWithTimeout(5)->send($request);
+
         return (new MapperBuilder())
             ->allowSuperfluousKeys()
             ->mapper()
index ef92ab2676cbd462124b25bdefc8d3ea81fd0eab..47ef8929ac7c6da992f85a6fe28665e309ed5037 100644 (file)
@@ -181,7 +181,7 @@ class LanguageAddForm extends AbstractFormBuilderForm
         ));
         $this->form->getDataHandler()->addProcessor(new CustomFormDataProcessor(
             'sourceLanguage',
-            function (IFormDocument $document, array $parameters) {
+            static function (IFormDocument $document, array $parameters) {
                 if ($document->getFormMode() !== IFormDocument::FORM_MODE_CREATE) {
                     return $parameters;
                 }
index 344968c34b2e5edcdd429f74f10f42860551c2b8..a9349f8d82823e815a357ac9b0e6256901dc02e3 100644 (file)
@@ -219,7 +219,6 @@ class Style extends DatabaseObject
             $this->variables['wcfPageThemeColor'] = $this->variables['wcfHeaderBackground'];
         }
         if ($this->hasDarkMode && empty($this->variables[self::DARK_MODE_PREFIX . 'wcfPageThemeColor'])) {
-
             $this->variables[self::DARK_MODE_PREFIX . 'wcfPageThemeColor'] = $this->variables[self::DARK_MODE_PREFIX . 'wcfHeaderBackground'];
         }
 
index 9207f6c8c2fbdd7f1378dd4520a93bda5d2e89b9..7ea78a4ab7b9c7acbc5a1879bc1d1843732c90d6 100644 (file)
@@ -3,7 +3,6 @@
 namespace wcf\data\user\rank;
 
 use wcf\data\I18nDatabaseObjectList;
-use wcf\data\user\rank\UserRank;
 
 /**
  * I18n implementation of user rank list.
index a671b712e6eaba908eb5685db8fe0fc40952e1d8..6d108c1d16c1ff39f574d027bbf042639921b5b3 100644 (file)
@@ -73,7 +73,6 @@ final class AttachmentBBCode extends AbstractBBCode
         // TODO: Remove this.
         $width = 'auto';
 
-
         if ($thumbnail) {
             return $this->showImageAsThumbnail(
                 $attachment,
index a7da0447f4477e296065a53927b8e26fd7566f93..49ec598a09d5f5c4711aefc1787c8ce855659b95 100644 (file)
@@ -3,7 +3,6 @@
 namespace wcf\system\category;
 
 use wcf\data\article\ArticleAction;
-use wcf\data\article\ArticleList;
 use wcf\data\category\CategoryEditor;
 use wcf\system\WCF;
 
index cb1362e6de5140dc2f3ffeb791ef623ac332282c..e6f1178f26c8c02afd9a424a88ace146473c129e 100644 (file)
@@ -9,7 +9,6 @@ use wcf\system\bbcode\HtmlBBCodeParser;
 use wcf\system\html\node\AbstractHtmlNodeProcessor;
 use wcf\util\DOMUtil;
 use wcf\util\JSON;
-use wcf\util\StringUtil;
 
 /**
  * Processes `<img>` to handle embedded attachments.
@@ -274,10 +273,10 @@ class HtmlInputNodeImg extends AbstractHtmlInputNode
         // of the resize operation.
         if ($element->parentNode->nodeName === 'figure') {
             $this->mirrorWidthAttribute($element->parentNode);
+
             return;
         }
 
-
         $width = $element->getAttribute("data-width");
         if ($width && $width !== "100%") {
             $style = $element->getAttribute("style");
index 4e59b2020018500c0dd83fda54be2adfcdb8278a..045009d8f7c3dc53599615c88b929aae08cb7316 100644 (file)
@@ -421,7 +421,7 @@ class HtmlInputNodeTextParser
     protected function parseURL(\DOMText $text, $value, $allowURL, $allowMedia)
     {
         return \preg_replace_callback(
-            "#(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'\".,<>?«»“”‘’]))#iS",
+            "#(?i)\\b((?:https?://|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))#iS",
             function ($matches) use ($text, $allowURL, $allowMedia) {
                 $link = $matches[0];
 
index 1676923e7f64ddaff719db29835af76ccfdc0dde..1009f83048d93bd6ad9dc5706893cf3729c13233 100644 (file)
@@ -310,12 +310,12 @@ class HtmlOutputNodeProcessor extends AbstractHtmlNodeProcessor
         foreach ($elementsWithStyles as $element) {
             $style = $element->getAttribute("style");
             $values = \array_map(
-                fn (string $value) => StringUtil::trim($value),
+                static fn (string $value) => StringUtil::trim($value),
                 \explode(";", $style)
             );
 
             $values = \array_filter($values, static function (string $value) {
-                list($keyword,) = \explode(":", $value, 2);
+                [$keyword] = \explode(":", $value, 2);
 
                 switch (StringUtil::trim($keyword)) {
                     case "color":
index 9fdf7e357d9bd0e2c711174bb0553cc49dda0b6f..ac2d7013b89fd811093385710193186dbc2cbd77 100644 (file)
@@ -127,7 +127,7 @@ class CronjobPackageInstallationPlugin extends AbstractXMLPackageInstallationPlu
         }
 
         return new CronExpression(match ($expression) {
-            '@hourly' => \sprintf('%d * * * *', $engine(0, 59)), 
+            '@hourly' => \sprintf('%d * * * *', $engine(0, 59)),
             '@daily' => \sprintf('%d %d * * *', $engine(0, 59), $engine(0, 23)),
             '@weekly' => \sprintf('%d %d * * %d', $engine(0, 59), $engine(0, 23), $engine(0, 6)),
             '@monthly' => \sprintf('%d %d %d * *', $engine(0, 59), $engine(0, 23), $engine(1, 28)),
index aeab232ded3b384d3d4dd1192d880d1d772f6771..3098e3ce59f747da2a81c3a896a8cd5ab871bd73 100644 (file)
@@ -9,7 +9,6 @@ use wcf\system\application\ApplicationHandler;
 use wcf\system\exception\SystemException;
 use wcf\system\search\mysql\MysqlSearchIndexManager;
 use wcf\system\SingletonFactory;
-use wcf\util\StringUtil;
 
 /**
  * Manages the search index.
index fccdc3effef76ca0e2038b506bc1ad08d2c82e5f..40928cb158b8779105d0c08a574363862cb081fb 100644 (file)
@@ -37,10 +37,10 @@ final class TimeFunctionTemplatePlugin implements IFunctionTemplatePlugin
 
         if ($time instanceof \DateTimeImmutable) {
             $dateTime = $time;
-        } else if ($time instanceof \DateTime) {
+        } elseif ($time instanceof \DateTime) {
             // Ensure we do not modify the original object.
             $dateTime = \DateTimeImmutable::createFromMutable($time);
-        } else if (\is_string($time) || \is_int($time)) {
+        } elseif (\is_string($time) || \is_int($time)) {
             $timestamp = \intval($time);
             $dateTime = (new \DateTimeImmutable('@' . $timestamp));
         } else {
index c14f1d2e725ae99c4a74165fd5b644dcac4ed7a8..00f8fc1d4b0c85383904c3a49d225ce1b32e2c99 100644 (file)
@@ -8,7 +8,7 @@ use wcf\system\event\TInterruptableEvent;
 /**
  * Indicates that a username is currently validated. If this event
  * is interrupted, the username is considered to be invalid.
- * 
+ *
  * This event will not be fired for usernames changed by an administrator.
  *
  * @author Tim Duesterhus
index 8845425c474e6ff19383aabb6a33fc1d3bb001fc..1c52ff80bb0f5c5262fc837ff99e3d527edd952b 100644 (file)
@@ -76,10 +76,10 @@ abstract class AbstractCommentResponseUserNotificationEvent extends AbstractShar
     /**
      * Returns the name of the type to which the comment belong.
      */
-    protected abstract function getTypeName(): string;
+    abstract protected function getTypeName(): string;
 
     /**
      * Returns the title of the object to which the comment belong.
      */
-    protected abstract function getObjectTitle(): string;
+    abstract protected function getObjectTitle(): string;
 }
index 5eb5360a5c4fa9b758f6619a6e043e1adc3fbd81..77b91070b1263b5f631532f5db9d92a88841be62 100644 (file)
@@ -57,10 +57,10 @@ abstract class AbstractCommentUserNotificationEvent extends AbstractSharedUserNo
     /**
      * Returns the name of the type to which the comment belong.
      */
-    protected abstract function getTypeName(): string;
+    abstract protected function getTypeName(): string;
 
     /**
      * Returns the title of the object to which the comment belong.
      */
-    protected abstract function getObjectTitle(): string;
+    abstract protected function getObjectTitle(): string;
 }
index f730bad6686e1af55956e7ae5d0194906dd422a9..df7893f7a302d5e508f6fac30bb222de67a44686 100644 (file)
@@ -2,8 +2,6 @@
 
 namespace wcf\util;
 
-use wcf\system\exception\SystemException;
-
 /**
  * Provides helper methods to work with PHP's DOM implementation.
  *
index d31e9d3217c9a52caea2c27dc230d2629297826b..c1d5a4ad20f06b0bca6db162057c605506ee083a 100644 (file)
@@ -2,7 +2,6 @@
 
 namespace wcf\util;
 
-use Spoofchecker;
 use wcf\system\event\EventHandler;
 use wcf\system\user\event\UsernameValidating;