Preserve names of method arguments during inheritance
authorMatthias Schmidt <gravatronics@live.com>
Fri, 14 May 2021 06:34:25 +0000 (08:34 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 14 May 2021 06:34:25 +0000 (08:34 +0200)
Close #4211

23 files changed:
wcfsetup/install/files/lib/data/DatabaseObjectList.class.php
wcfsetup/install/files/lib/data/comment/LikeableCommentProvider.class.php
wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponseProvider.class.php
wcfsetup/install/files/lib/data/label/group/ViewableLabelGroup.class.php
wcfsetup/install/files/lib/data/smiley/category/SmileyCategory.class.php
wcfsetup/install/files/lib/system/bbcode/MessageParser.class.php
wcfsetup/install/files/lib/system/bbcode/highlighter/DiffHighlighter.class.php
wcfsetup/install/files/lib/system/bbcode/highlighter/PhpHighlighter.class.php
wcfsetup/install/files/lib/system/bbcode/highlighter/PlainHighlighter.class.php
wcfsetup/install/files/lib/system/database/table/column/ObjectIdDatabaseTableColumn.class.php
wcfsetup/install/files/lib/system/database/util/ConditionBuilder.class.php
wcfsetup/install/files/lib/system/form/builder/button/IFormButton.class.php
wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeImg.class.php
wcfsetup/install/files/lib/system/io/Tar.class.php
wcfsetup/install/files/lib/system/io/Zip.class.php
wcfsetup/install/files/lib/system/option/user/group/UserGroupOptionHandler.class.php
wcfsetup/install/files/lib/system/package/plugin/ACPTemplatePackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/AbstractPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/AbstractXMLPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/FilePackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/LanguagePackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/SQLPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/TemplatePackageInstallationPlugin.class.php

index 4762ea07c6e3d5a9f334d951bf07200dcac70fae..c47a762e7c7d8de595ab257bbc085692b9da9930 100644 (file)
@@ -362,9 +362,9 @@ abstract class DatabaseObjectList implements \Countable, ITraversableObject
     /**
      * @inheritDoc
      */
-    public function seek($index)
+    public function seek($offset)
     {
-        $this->index = $index;
+        $this->index = $offset;
 
         if (!$this->valid()) {
             throw new \OutOfBoundsException();
index 90ca6ee0ca90991b2752f28142c011e38bcb61ff..91531512f4d4f0c403166cdcc75de74837d21786 100644 (file)
@@ -41,17 +41,17 @@ class LikeableCommentProvider extends AbstractObjectTypeProvider implements
     /**
      * @inheritDoc
      */
-    public function checkPermissions(ILikeObject $comment)
+    public function checkPermissions(ILikeObject $object)
     {
-        /** @var Comment $comment */
+        /** @var Comment $object */
 
-        if (!$comment->commentID) {
+        if (!$object->commentID) {
             return false;
         }
 
-        $objectType = CommentHandler::getInstance()->getObjectType($comment->objectTypeID);
+        $objectType = CommentHandler::getInstance()->getObjectType($object->objectTypeID);
 
-        return CommentHandler::getInstance()->getCommentManager($objectType->objectType)->isAccessible($comment->objectID);
+        return CommentHandler::getInstance()->getCommentManager($objectType->objectType)->isAccessible($object->objectID);
     }
 
     /**
index ec434bdd1f0ae61d02dca9b5faf4b0874823539b..a40a21c4938c146c707a8c5284a58c8d8c318f4d 100644 (file)
@@ -44,14 +44,14 @@ class LikeableCommentResponseProvider extends AbstractObjectTypeProvider impleme
     /**
      * @inheritDoc
      */
-    public function checkPermissions(ILikeObject $response)
+    public function checkPermissions(ILikeObject $object)
     {
-        /** @var CommentResponse $response */
+        /** @var CommentResponse $object */
 
-        if (!$response->responseID) {
+        if (!$object->responseID) {
             return false;
         }
-        $comment = new Comment($response->commentID);
+        $comment = new Comment($object->commentID);
         if (!$comment->commentID) {
             return false;
         }
index 136796f8f936af1f465c8890cafe3910cce59f0a..3e57254224614ae940351ce95c3315d89bba0ebd 100644 (file)
@@ -224,9 +224,9 @@ class ViewableLabelGroup extends DatabaseObjectDecorator implements \Countable,
     /**
      * @inheritDoc
      */
-    public function seek($index)
+    public function seek($offset)
     {
-        $this->index = $index;
+        $this->index = $offset;
 
         if (!$this->valid()) {
             throw new \OutOfBoundsException();
index 9aa89c22c61f7a676c211d631d6e89d05a475ed5..53ceb156f4c9ce17dc7b9f2a1ea721f0a2b7bead 100644 (file)
@@ -111,9 +111,9 @@ class SmileyCategory extends AbstractDecoratedCategory implements \Countable, IT
     /**
      * @inheritDoc
      */
-    public function seek($index)
+    public function seek($offset)
     {
-        $this->index = $index;
+        $this->index = $offset;
 
         if (!$this->valid()) {
             throw new \OutOfBoundsException();
index 9b0574f813864903351d00c2c6f53c68a248b647..fa12a5310d4cc7ec0602ed3404dabefa33a8ea04 100644 (file)
@@ -67,7 +67,7 @@ class MessageParser extends BBCodeParser
     /**
      * Parses a message.
      *
-     * @param string $message
+     * @param string $text
      * @param bool $enableSmilies
      * @param bool $enableHtml
      * @param bool $enableBBCodes
@@ -75,14 +75,14 @@ class MessageParser extends BBCodeParser
      * @return  string      parsed message
      */
     public function parse(
-        $message,
+        $text,
         $enableSmilies = true,
         $enableHtml = false,
         $enableBBCodes = true,
         $doKeywordHighlighting = true
     ) {
         $this->cachedCodes = [];
-        $this->message = $message;
+        $this->message = $text;
 
         // call event
         EventHandler::getInstance()->fireAction($this, 'beforeParsing');
index 5ca4ceedc4383b091ad60748633e1eb84d616087..36445c5b99a619edc94b2d5fd796681a07286ee5 100644 (file)
@@ -45,9 +45,9 @@ class DiffHighlighter extends Highlighter
     /**
      * @inheritDoc
      */
-    public function highlight($data)
+    public function highlight($string)
     {
-        $lines = \explode("\n", $data);
+        $lines = \explode("\n", $string);
         foreach ($lines as $key => $val) {
             if (\in_array(\mb_substr($val, 0, 1), $this->info) || \in_array($val, $this->splitter)) {
                 $lines[$key] = '<span class="hlComments">' . StringUtil::encodeHTML($val) . '</span>';
index 2bf1fe2c9f05c74ce615b5cef16f5e39858e7bcb..825507b554ef1275411c28abaff92d5e436a11b1 100644 (file)
@@ -40,17 +40,17 @@ class PhpHighlighter extends Highlighter
     /**
      * @inheritDoc
      */
-    public function highlight($code)
+    public function highlight($string)
     {
         // add starting php tag
         $phpTagsAdded = false;
-        if (\mb_strpos($code, '<?') === false) {
+        if (\mb_strpos($string, '<?') === false) {
             $phpTagsAdded = true;
-            $code = '<?php ' . $code . ' ?>';
+            $string = '<?php ' . $string . ' ?>';
         }
 
         // do highlight
-        $highlightedCode = \highlight_string($code, true);
+        $highlightedCode = \highlight_string($string, true);
 
         // clear code
         $highlightedCode = \str_replace('<code>', '', $highlightedCode);
index 8d50cdbbbd07b3f46f9cb8ae1d1245ec0009edb5..33b2b619fc4fe14a6b23c98a291f52e95d2e5a3b 100644 (file)
@@ -18,8 +18,8 @@ class PlainHighlighter extends Highlighter
     /**
      * @inheritDoc
      */
-    public function highlight($code)
+    public function highlight($string)
     {
-        return StringUtil::encodeHTML($code);
+        return StringUtil::encodeHTML($string);
     }
 }
index ef8a46c82266e0858933dec342029ff07240efff..33bd990abd54b954a8c786fa2a8c46e3cb28bceb 100644 (file)
@@ -19,9 +19,9 @@ class ObjectIdDatabaseTableColumn extends NotNullInt10DatabaseTableColumn
     /**
      * @inheritDoc
      */
-    public static function create($columnName)
+    public static function create($name)
     {
-        return parent::create($columnName)
+        return parent::create($name)
             ->autoIncrement();
     }
 }
index a2223a998f9dc8fee75e8e17ec248f2dcfe8aa49..c2d10ddc80fd9b80732e3a99c39804aec059663e 100644 (file)
@@ -45,12 +45,13 @@ class ConditionBuilder
     /**
      * Adds a new condition.
      *
-     * @param mixed $conditions
+     * @param mixed $condition
      */
-    public function add($conditions)
+    public function add($condition)
     {
+        $conditions = $condition;
         if (!\is_array($conditions)) {
-            $conditions = [$conditions];
+            $conditions = [$condition];
         }
 
         foreach ($conditions as $condition) {
index f142d8895b057e54da910369b16feb3ba16cebc4..8b7c343517643c579161cc31b9d9fabcb8c842cd 100644 (file)
@@ -46,8 +46,8 @@ interface IFormButton extends IFormChildNode, IFormElement
     /**
      * Sets whether this button is an `input[type=submit]` element or a `button` element.
      *
-     * @param bool $submitButton
+     * @param bool $submit
      * @return  static              this form button
      */
-    public function submit($submitButton = true);
+    public function submit($submit = true);
 }
index 525d4dbaab248d9d093de6560a82204b6a141889..cce9f25a4639ad5c87e5eea9c85b43befce61abd 100644 (file)
@@ -35,7 +35,7 @@ class HtmlInputNodeImg extends AbstractHtmlInputNode
     /**
      * @inheritDoc
      */
-    public function isAllowed(AbstractHtmlNodeProcessor $nodeProcessor)
+    public function isAllowed(AbstractHtmlNodeProcessor $htmlNodeProcessor)
     {
         if (BBCodeHandler::getInstance()->isAvailableBBCode('img')) {
             return [];
@@ -45,7 +45,7 @@ class HtmlInputNodeImg extends AbstractHtmlInputNode
 
         // check if there are only attachments, media or smilies
         /** @var \DOMElement $element */
-        foreach ($nodeProcessor->getDocument()->getElementsByTagName('img') as $element) {
+        foreach ($htmlNodeProcessor->getDocument()->getElementsByTagName('img') as $element) {
             $class = $element->getAttribute('class');
             if (!\preg_match('~\b(?:woltlabAttachment|woltlabSuiteMedia|smiley)\b~', $class)) {
                 $foundImage = true;
index f46f885d4dae9b4ef516161d33c9dad1e108bd65..b4bc145865cde311ee3e35eb1b9e46df91a1e852 100644 (file)
@@ -147,17 +147,17 @@ class Tar implements IArchive
     /**
      * @inheritDoc
      */
-    public function getFileInfo($fileIndex)
+    public function getFileInfo($index)
     {
-        if (!\is_int($fileIndex)) {
-            $fileIndex = $this->getIndexByFilename($fileIndex);
+        if (!\is_int($index)) {
+            $index = $this->getIndexByFilename($index);
         }
 
-        if (!isset($this->contentList[$fileIndex])) {
-            throw new SystemException("Tar: could find file '" . $fileIndex . "' in archive");
+        if (!isset($this->contentList[$index])) {
+            throw new SystemException("Tar: could find file '" . $index . "' in archive");
         }
 
-        return $this->contentList[$fileIndex];
+        return $this->contentList[$index];
     }
 
     /**
index f5135177451e5129bfce8926ab4198e98b3a49fc..47df98b9b1af7874ad99b8bef6a035bdaac8425b 100644 (file)
@@ -58,13 +58,13 @@ class Zip extends File implements IArchive
     /**
      * @inheritDoc
      */
-    public function getFileInfo($offset)
+    public function getFileInfo($index)
     {
-        if (!\is_int($offset)) {
-            $offset = $this->getIndexByFilename($offset);
+        if (!\is_int($index)) {
+            $index = $this->getIndexByFilename($index);
         }
 
-        $info = $this->readFile($offset);
+        $info = $this->readFile($index);
 
         return $info['header'];
     }
@@ -91,14 +91,14 @@ class Zip extends File implements IArchive
     /**
      * @inheritDoc
      */
-    public function extractToString($offset)
+    public function extractToString($index)
     {
-        if (!\is_int($offset)) {
-            $offset = $this->getIndexByFilename($offset);
+        if (!\is_int($index)) {
+            $index = $this->getIndexByFilename($index);
         }
 
         try {
-            $file = $this->readFile($offset);
+            $file = $this->readFile($index);
         } catch (SystemException $e) {
             return false;
         }
@@ -112,14 +112,14 @@ class Zip extends File implements IArchive
     /**
      * @inheritDoc
      */
-    public function extract($offset, $destination)
+    public function extract($index, $destination)
     {
-        if (!\is_int($offset)) {
-            $offset = $this->getIndexByFilename($offset);
+        if (!\is_int($index)) {
+            $index = $this->getIndexByFilename($index);
         }
 
         try {
-            $file = $this->readFile($offset);
+            $file = $this->readFile($index);
         } catch (SystemException $e) {
             return false;
         }
index 3d1573cddaf19914cd4bb2c76e5435ce3167fc5f..6ce929b32a9a9dbcb83603a5365306138ecaf7ec 100644 (file)
@@ -89,9 +89,9 @@ class UserGroupOptionHandler extends OptionHandler
     /**
      * @inheritDoc
      */
-    protected function getClassName($type)
+    protected function getClassName($optionType)
     {
-        $className = 'wcf\system\option\user\group\\' . \ucfirst($type) . 'UserGroupOptionType';
+        $className = 'wcf\system\option\user\group\\' . \ucfirst($optionType) . 'UserGroupOptionType';
 
         // validate class
         if (!\class_exists($className)) {
index 9cc8903fd0d2b399e2d8d0133e5937e4d1a09978..0cc8285fa81306fd1f55dbbd91f288cad48eeb8d 100644 (file)
@@ -103,7 +103,7 @@ class ACPTemplatePackageInstallationPlugin extends AbstractPackageInstallationPl
     /**
      * @inheritDoc
      */
-    public static function isValid(PackageArchive $archive, $instruction)
+    public static function isValid(PackageArchive $packageArchive, $instruction)
     {
         if (!$instruction) {
             $instruction = static::getDefaultFilename();
@@ -112,7 +112,7 @@ class ACPTemplatePackageInstallationPlugin extends AbstractPackageInstallationPl
         if (\preg_match('~\.(tar(\.gz)?|tgz)$~', $instruction)) {
             // check if file actually exists
             try {
-                if ($archive->getTar()->getIndexByFilename($instruction) === false) {
+                if ($packageArchive->getTar()->getIndexByFilename($instruction) === false) {
                     return false;
                 }
             } catch (SystemException $e) {
index ad8d5464b82e468fd13bab5ddac7215c32ec98dc..19ab9ab5701e1115dd116f2e2348d6117f56aebe 100644 (file)
@@ -119,7 +119,7 @@ abstract class AbstractPackageInstallationPlugin implements IPackageInstallation
     /**
      * @inheritDoc
      */
-    public static function isValid(PackageArchive $archive, $instruction)
+    public static function isValid(PackageArchive $packageArchive, $instruction)
     {
         return true;
     }
index 5238e11329350732e08468a09e68ab1c35b3857b..1988cd0428d036d1233c867976825913d7aabf13 100644 (file)
@@ -452,7 +452,7 @@ abstract class AbstractXMLPackageInstallationPlugin extends AbstractPackageInsta
     /**
      * @inheritDoc
      */
-    public static function isValid(PackageArchive $archive, $instruction)
+    public static function isValid(PackageArchive $packageArchive, $instruction)
     {
         if (!$instruction) {
             $defaultFilename = static::getDefaultFilename();
@@ -464,7 +464,7 @@ abstract class AbstractXMLPackageInstallationPlugin extends AbstractPackageInsta
         if (\preg_match('~\.xml$~', $instruction)) {
             // check if file actually exists
             try {
-                if ($archive->getTar()->getIndexByFilename($instruction) === false) {
+                if ($packageArchive->getTar()->getIndexByFilename($instruction) === false) {
                     return false;
                 }
             } catch (SystemException $e) {
index 8020b521b03345ea8190d252d9961eed8b5b5f8c..f72ff426bb1546d0af327d18aba9bf05dbd631c6 100644 (file)
@@ -126,7 +126,7 @@ class FilePackageInstallationPlugin extends AbstractPackageInstallationPlugin im
     /**
      * @inheritDoc
      */
-    public static function isValid(PackageArchive $archive, $instruction)
+    public static function isValid(PackageArchive $packageArchive, $instruction)
     {
         if (!$instruction) {
             $instruction = static::getDefaultFilename();
@@ -135,7 +135,7 @@ class FilePackageInstallationPlugin extends AbstractPackageInstallationPlugin im
         if (\preg_match('~\.(tar(\.gz)?|tgz)$~', $instruction)) {
             // check if file actually exists
             try {
-                if ($archive->getTar()->getIndexByFilename($instruction) === false) {
+                if ($packageArchive->getTar()->getIndexByFilename($instruction) === false) {
                     return false;
                 }
             } catch (SystemException $e) {
index 2ed0d7730a697c0377e7f220ef1b9458bffa26b2..6b2bd45347cf1ce16804d39a244cad6124908446 100644 (file)
@@ -326,7 +326,7 @@ class LanguagePackageInstallationPlugin extends AbstractXMLPackageInstallationPl
     /**
      * @inheritDoc
      */
-    public static function isValid(PackageArchive $archive, $instruction)
+    public static function isValid(PackageArchive $packageArchive, $instruction)
     {
         return true;
     }
index 1298eebf7860697835336fe90efd8a87d7e50d83..35941e9d4e39037fd7e69dd5db43dc5bdfd35ca9 100644 (file)
@@ -168,7 +168,7 @@ class SQLPackageInstallationPlugin extends AbstractPackageInstallationPlugin
     /**
      * @inheritDoc
      */
-    public static function isValid(PackageArchive $archive, $instruction)
+    public static function isValid(PackageArchive $packageArchive, $instruction)
     {
         if (!$instruction) {
             $instruction = static::getDefaultFilename();
@@ -177,7 +177,7 @@ class SQLPackageInstallationPlugin extends AbstractPackageInstallationPlugin
         if (\preg_match('~\.sql$~', $instruction)) {
             // check if file actually exists
             try {
-                if ($archive->getTar()->getIndexByFilename($instruction) === false) {
+                if ($packageArchive->getTar()->getIndexByFilename($instruction) === false) {
                     return false;
                 }
             } catch (SystemException $e) {
index 85bb5d239e180108e452db20371fad7f58f77d4c..d3d0b63bc4cc6389e6bef6fee166a10c3ae49b07 100644 (file)
@@ -105,7 +105,7 @@ class TemplatePackageInstallationPlugin extends AbstractPackageInstallationPlugi
     /**
      * @inheritDoc
      */
-    public static function isValid(PackageArchive $archive, $instruction)
+    public static function isValid(PackageArchive $packageArchive, $instruction)
     {
         if (!$instruction) {
             $instruction = static::getDefaultFilename();
@@ -114,7 +114,7 @@ class TemplatePackageInstallationPlugin extends AbstractPackageInstallationPlugi
         if (\preg_match('~\.(tar(\.gz)?|tgz)$~', $instruction)) {
             // check if file actually exists
             try {
-                if ($archive->getTar()->getIndexByFilename($instruction) === false) {
+                if ($packageArchive->getTar()->getIndexByFilename($instruction) === false) {
                     return false;
                 }
             } catch (SystemException $e) {