Add @noinspection PhpVariableVariableInspection tags
authorMatthias Schmidt <gravatronics@live.com>
Sat, 21 May 2016 20:06:41 +0000 (22:06 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 21 May 2016 20:06:41 +0000 (22:06 +0200)
wcfsetup/install/files/lib/data/AbstractDatabaseObjectAction.class.php
wcfsetup/install/files/lib/data/DatabaseObject.class.php
wcfsetup/install/files/lib/data/TLegacyUserPropertyAccess.class.php
wcfsetup/install/files/lib/data/media/MediaAction.class.php
wcfsetup/install/files/lib/data/user/UserProfile.class.php
wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php
wcfsetup/install/files/lib/system/condition/UserGroupCondition.class.php
wcfsetup/install/files/lib/system/condition/UserStateCondition.class.php
wcfsetup/install/files/lib/system/search/acp/AbstractACPSearchResultProvider.class.php
wcfsetup/install/files/lib/system/user/UserProfileHandler.class.php

index 34daad25a38534c4ea874e599bc562d5c9c3d730..a7fe5f7a0e16d5a2f19a6d825d7f7c4892dcb723 100644 (file)
@@ -135,6 +135,7 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID
                                        throw new SystemException('invalid value of parameter objects given');
                                }
                                
+                               /** @noinspection PhpVariableVariableInspection */
                                $this->objectIDs[] = $object->$indexName;
                        }
                        else {
index 0277786bd686c520f02679a1005af6642668022d..d0bf669b61847096e483678914e160fbabb9603f 100644 (file)
@@ -165,6 +165,7 @@ abstract class DatabaseObject implements IStorableObject {
        public static function sort(&$objects, $sortBy, $sortOrder = 'ASC', $maintainIndexAssociation = true) {
                $sortArray = $objects2 = [];
                foreach ($objects as $idx => $obj) {
+                       /** @noinspection PhpVariableVariableInspection */
                        $sortArray[$idx] = $obj->$sortBy;
                        
                        // array_multisort will drop index association if key is not a string
index b47b14161489adfb8a1d56d58016fb0c9d105d72..87d2d8ba4e1910e0fb7b726b45bd8dff32b9f961 100644 (file)
@@ -37,6 +37,7 @@ trait TLegacyUserPropertyAccess {
                
                // in case any code should rely on directly accessing user properties,
                // refer them to the user profile object
+               /** @noinspection PhpVariableVariableInspection */
                return $this->getUserProfile()->$name;
        }
 }
index afff874c5d3bfb3e4fb3cc39ef0ace541e8d0c9d..5816578571407700d3138396caa9be8b83373c62 100644 (file)
@@ -333,10 +333,12 @@ class MediaAction extends AbstractDatabaseObjectAction implements ISearchAction,
                                                if (isset($this->parameters[$type])) {
                                                        if (is_array($this->parameters[$type])) {
                                                                if (isset($this->parameters[$type][$language->languageID])) {
+                                                                       /** @noinspection PhpVariableVariableInspection */
                                                                        $$type = $this->parameters[$type][$language->languageID];
                                                                }
                                                        }
                                                        else {
+                                                               /** @noinspection PhpVariableVariableInspection */
                                                                $$type = $this->parameters[$type];
                                                        }
                                                }
index 7e12afb2e036bf3a79ebf4caf38bf6442f9b1fd5..0d0a7799c9578de6ad308338052facff28d931d6 100644 (file)
@@ -440,6 +440,7 @@ class UserProfile extends DatabaseObjectDecorator implements ITitledLinkObject {
         * @return      boolean
         */
        public function isAccessible($name) {
+               /** @noinspection PhpVariableVariableInspection */
                switch ($this->$name) {
                        case self::ACCESS_EVERYONE:
                                return true;
index 4358ed696a48c59159788e8ce3fe115b17ce551e..76e087519aa73be0c62c19465a9a945c679afe17 100644 (file)
@@ -247,6 +247,7 @@ class ClipboardHandler extends SingletonFactory {
                        // validate object ids against loaded items (check for zombie object ids)
                        $indexName = $objectList->getDatabaseTableIndexName();
                        foreach ($this->markedItems[$objectType] as $object) {
+                               /** @noinspection PhpVariableVariableInspection */
                                $index = array_search($object->$indexName, $objectData['objectIDs']);
                                unset($objectData['objectIDs'][$index]);
                        }
index b8ffbe4e5d151ff6f024824379972b37505e3448..0b270972934b3e53c6c94ba972f023bc51537bc3 100644 (file)
@@ -144,6 +144,7 @@ HTML;
                
                $returnValue = "";
                foreach ($userGroups as $userGroup) {
+                       /** @noinspection PhpVariableVariableInspection */
                        $returnValue .= "<label><input type=\"checkbox\" name=\"".$identifier."[]\" value=\"".$userGroup->groupID."\"".(in_array($userGroup->groupID, $this->$identifier) ? ' checked="checked"' : "")." /> ".$userGroup->getName()."</label>";
                }
                
index 6276adc65a6b08613605c3b6d9f3f922f9009454..f8fa95f13075dce5af3d9bb1ffbd780e3d514302 100644 (file)
@@ -124,6 +124,7 @@ class UserStateCondition extends AbstractSingleFieldCondition implements IConten
         * @return      string
         */
        protected function getCheckedAttribute($propertyName) {
+               /** @noinspection PhpVariableVariableInspection */
                if ($this->$propertyName) {
                        return ' checked="checked"';
                }
index 0458939ec5eef7ec3e419c320beb326cde81505b..52cede72e6abaf19a983011dbeabf491015b2d07 100644 (file)
@@ -25,8 +25,10 @@ abstract class AbstractACPSearchResultProvider {
        protected function validate(DatabaseObject $object, $optionsColumnName = 'options', $permissionsColumnName = 'permissions') {
                // check the options of this item
                $hasEnabledOption = true;
+               /** @noinspection PhpVariableVariableInspection */
                if ($object->$optionsColumnName) {
                        $hasEnabledOption = false;
+                       /** @noinspection PhpVariableVariableInspection */
                        $options = explode(',', strtoupper($object->$optionsColumnName));
                        foreach ($options as $option) {
                                if (defined($option) && constant($option)) {
@@ -39,8 +41,10 @@ abstract class AbstractACPSearchResultProvider {
                
                // check the permission of this item for the active user
                $hasPermission = true;
+               /** @noinspection PhpVariableVariableInspection */
                if ($object->$permissionsColumnName) {
                        $hasPermission = false;
+                       /** @noinspection PhpVariableVariableInspection */
                        $permissions = explode(',', $object->$permissionsColumnName);
                        foreach ($permissions as $permission) {
                                if (WCF::getSession()->getPermission($permission)) {
index a14c839ce4a100c786101037e33ad326ea131618..44cc2e22a649ef649f4fe112156ae832c22e3500 100644 (file)
@@ -49,6 +49,7 @@ class UserProfileHandler extends SingletonFactory {
         * @return      mixed
         */
        public function __get($name) {
+               /** @noinspection PhpVariableVariableInspection */
                return $this->userProfile->$name;
        }