Fix warnings about undefined methods in data classes
authorMatthias Schmidt <gravatronics@live.com>
Sun, 29 May 2016 12:36:21 +0000 (14:36 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 29 May 2016 12:36:21 +0000 (14:36 +0200)
wcfsetup/install/files/lib/data/attachment/AttachmentAction.class.php
wcfsetup/install/files/lib/data/box/Box.class.php
wcfsetup/install/files/lib/data/language/LanguageEditor.class.php
wcfsetup/install/files/lib/data/like/LikeAction.class.php
wcfsetup/install/files/lib/data/like/ViewableLikeList.class.php
wcfsetup/install/files/lib/data/style/StyleAction.class.php
wcfsetup/install/files/lib/data/style/StyleEditor.class.php

index 6dfefbeff488cd6cf87cd48db8d37f3879f5c60f..8f1c669846551f249e65f095992e5432aab3b0f6 100644 (file)
@@ -12,6 +12,7 @@ use wcf\system\exception\UserInputException;
 use wcf\system\request\LinkHandler;
 use wcf\system\upload\DefaultUploadFileSaveStrategy;
 use wcf\system\upload\DefaultUploadFileValidationStrategy;
+use wcf\system\upload\UploadFile;
 use wcf\system\WCF;
 use wcf\util\ArrayUtil;
 use wcf\util\FileUtil;
@@ -177,6 +178,8 @@ class AttachmentAction extends AbstractDatabaseObjectAction implements ISortable
                        }
                }
                
+               /** @noinspection PhpUndefinedMethodInspection */
+               /** @var UploadFile[] $files */
                $files = $this->parameters['__files']->getFiles();
                foreach ($files as $file) {
                        if ($file->getValidationErrorType()) {
index 0cc2495ae8cb4c820dd1c6c2ca6cfb4b535681e2..1b727fcb3ac436518157cab514df809c1b7594f1 100644 (file)
@@ -473,7 +473,9 @@ class Box extends DatabaseObject {
         * @return      Condition[]
         */
        public function getConditions() {
+               /** @noinspection PhpUndefinedMethodInspection */
                if ($this->boxType === 'system' && $this->getController() instanceof IConditionBoxController && $this->getController()->getConditionDefinition()) {
+                       /** @noinspection PhpUndefinedMethodInspection */
                        return ConditionHandler::getInstance()->getConditions($this->getController()->getConditionDefinition(), $this->boxID);
                }
                
index c296a9f2060bfd79bd0ad08d7150d38c8b338a97..9825ab6835f5f0083f01a8b56bdae8cba7763b35 100644 (file)
@@ -183,6 +183,8 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje
                
                // fetch categories
                $categories = $xpath->query('/ns:language/ns:category');
+               
+               /** @var \DOMElement $category */
                foreach ($categories as $category) {
                        $usedCategories[$category->getAttribute('name')] = 0;
                }
@@ -214,12 +216,16 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje
                
                // loop through categories to import items
                $itemData = [];
+               
+               /** @var \DOMElement $category */
                foreach ($categories as $category) {
                        $categoryName = $category->getAttribute('name');
                        $categoryID = $usedCategories[$categoryName];
                        
                        // loop through items
                        $elements = $xpath->query('child::*', $category);
+                       
+                       /** @var \DOMElement $element */
                        foreach ($elements as $element) {
                                $itemName = $element->getAttribute('name');
                                $itemValue = $element->nodeValue;
index 73b3241bbc2d5a52951bfe9dd79ae8b75994fb89..3ab9500558fb2b15eed4b19fbe7f3c0297c2c93b 100644 (file)
@@ -91,10 +91,12 @@ class LikeAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                $values = [];
                if (!empty($data[Like::LIKE])) {
                        $values[Like::LIKE] = new GroupedUserList(WCF::getLanguage()->get('wcf.like.details.like'));
+                       /** @noinspection PhpUndefinedMethodInspection */
                        $values[Like::LIKE]->addUserIDs($data[Like::LIKE]);
                }
                if (!empty($data[Like::DISLIKE])) {
                        $values[Like::DISLIKE] = new GroupedUserList(WCF::getLanguage()->get('wcf.like.details.dislike'));
+                       /** @noinspection PhpUndefinedMethodInspection */
                        $values[Like::DISLIKE]->addUserIDs($data[Like::DISLIKE]);
                }
                
@@ -260,10 +262,12 @@ class LikeAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                $values = [];
                if (!empty($data[Like::LIKE])) {
                        $values[Like::LIKE] = new GroupedUserList(WCF::getLanguage()->get('wcf.like.details.like'));
+                       /** @noinspection PhpUndefinedMethodInspection */
                        $values[Like::LIKE]->addUserIDs($data[Like::LIKE]);
                }
                if (!empty($data[Like::DISLIKE])) {
                        $values[Like::DISLIKE] = new GroupedUserList(WCF::getLanguage()->get('wcf.like.details.dislike'));
+                       /** @noinspection PhpUndefinedMethodInspection */
                        $values[Like::DISLIKE]->addUserIDs($data[Like::DISLIKE]);
                }
                
index a75c7adae2e0360b5c6cbedb7781b55dfe24b036..cee47929bb117e758d88df26ed63b09701fa037e 100644 (file)
@@ -70,6 +70,7 @@ class ViewableLikeList extends LikeList {
                // parse like
                foreach ($likeGroups as $likeData) {
                        if ($likeData['provider'] instanceof IViewableLikeProvider) {
+                               /** @noinspection PhpUndefinedMethodInspection */
                                $likeData['provider']->prepare($likeData['objects']);
                        }
                }
index 73be5c9d8c75c534ac0ca06d0318d7e909e4a8e7..54759149b7cd8cb002ec5cf4393d909a9dc24d34 100644 (file)
@@ -284,6 +284,7 @@ class StyleAction extends AbstractDatabaseObjectAction implements IToggleAction,
         */
        public function upload() {
                // save files
+               /** @noinspection PhpUndefinedMethodInspection */
                /** @var UploadFile[] $files */
                $files = $this->parameters['__files']->getFiles();
                $file = $files[0];
@@ -365,6 +366,7 @@ class StyleAction extends AbstractDatabaseObjectAction implements IToggleAction,
         */
        public function uploadLogo() {
                // save files
+               /** @noinspection PhpUndefinedMethodInspection */
                /** @var UploadFile[] $files */
                $files = $this->parameters['__files']->getFiles();
                $file = $files[0];
index 5a24783ae5e84147bd276ba6be6095dfe2c3aac9..ca698d852e60cf1fb8b71a5534e15e650d40a945 100644 (file)
@@ -255,6 +255,8 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject
                $variables = $xml->xpath()->query('/ns:variables/ns:variable');
                
                $data = [];
+               
+               /** @var \DOMElement $variable */
                foreach ($variables as $variable) {
                        $data[$variable->getAttribute('name')] = $variable->nodeValue;
                }