Throw InvalidArgumentException for invalid condition object lists
authorMatthias Schmidt <gravatronics@live.com>
Fri, 6 May 2016 13:37:56 +0000 (15:37 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 6 May 2016 13:37:56 +0000 (15:37 +0200)
29 files changed:
wcfsetup/install/files/lib/system/condition/AbstractCondition.class.php
wcfsetup/install/files/lib/system/condition/AbstractIntegerCondition.class.php
wcfsetup/install/files/lib/system/condition/AbstractMultiSelectCondition.class.php
wcfsetup/install/files/lib/system/condition/AbstractMultipleFieldsCondition.class.php
wcfsetup/install/files/lib/system/condition/AbstractObjectTextPropertyCondition.class.php
wcfsetup/install/files/lib/system/condition/AbstractSingleFieldCondition.class.php
wcfsetup/install/files/lib/system/condition/AbstractTextCondition.class.php
wcfsetup/install/files/lib/system/condition/AbstractTimestampCondition.class.php
wcfsetup/install/files/lib/system/condition/DaysOfWeekCondition.class.php
wcfsetup/install/files/lib/system/condition/IContentCondition.class.php
wcfsetup/install/files/lib/system/condition/IObjectCondition.class.php
wcfsetup/install/files/lib/system/condition/IObjectListCondition.class.php
wcfsetup/install/files/lib/system/condition/IUserCondition.class.php
wcfsetup/install/files/lib/system/condition/TObjectListUserCondition.class.php
wcfsetup/install/files/lib/system/condition/TObjectUserCondition.class.php
wcfsetup/install/files/lib/system/condition/TimeCondition.class.php
wcfsetup/install/files/lib/system/condition/UserAvatarCondition.class.php
wcfsetup/install/files/lib/system/condition/UserBirthdayCondition.class.php
wcfsetup/install/files/lib/system/condition/UserEmailCondition.class.php
wcfsetup/install/files/lib/system/condition/UserGroupCondition.class.php
wcfsetup/install/files/lib/system/condition/UserIntegerPropertyCondition.class.php
wcfsetup/install/files/lib/system/condition/UserLanguageCondition.class.php
wcfsetup/install/files/lib/system/condition/UserMobileBrowserCondition.class.php
wcfsetup/install/files/lib/system/condition/UserOptionsCondition.class.php
wcfsetup/install/files/lib/system/condition/UserRegistrationDateCondition.class.php
wcfsetup/install/files/lib/system/condition/UserRegistrationDateIntervalCondition.class.php
wcfsetup/install/files/lib/system/condition/UserStateCondition.class.php
wcfsetup/install/files/lib/system/condition/UserTimestampPropertyCondition.class.php
wcfsetup/install/files/lib/system/condition/UserUsernameCondition.class.php

index 1621127daea73b303af994f2db3ad704b6f0104e..c41429aae38dd5c60c704778a23bf8fe3467388b 100644 (file)
@@ -6,7 +6,7 @@ use wcf\data\object\type\AbstractObjectTypeProcessor;
  * Abstract implementation of a condition.
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -14,14 +14,14 @@ use wcf\data\object\type\AbstractObjectTypeProcessor;
  */
 abstract class AbstractCondition extends AbstractObjectTypeProcessor implements ICondition {
        /**
-        * @see \wcf\system\condition\ICondition::reset()
+        * @inheritDoc
         */
        public function reset() {
                // does nothing
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::validate()
+        * @inheritDoc
         */
        public function validate() {
                // does nothing
index a22aeae796f005e70f6311e87d8d235c24f9c499..3d8c5ed97a6a2bf9b0bdc7470cdceda6fad13ec9 100644 (file)
@@ -8,7 +8,7 @@ use wcf\system\WCF;
  * Abstract implementation of a condition for an integer value.
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -52,10 +52,10 @@ abstract class AbstractIntegerCondition extends AbstractSingleFieldCondition {
        protected $propertyName = '';
        
        /**
-        * @see \wcf\system\condition\ICondition::getData()
+        * @inheritDoc
         */
        public function getData() {
-               $data = array();
+               $data = [];
                
                if ($this->lessThan !== null) {
                        $data['lessThan'] = $this->lessThan;
@@ -72,34 +72,34 @@ abstract class AbstractIntegerCondition extends AbstractSingleFieldCondition {
        }
        
        /**
-        * @see \wcf\system\condition\AbstractMultipleFieldsCondition::getData()
+        * @inheritDoc
         */
        protected function getErrorMessageElement() {
                if ($this->errorMessage) {
                        $errorMessage = '';
                        switch ($this->errorMessage) {
                                case 'wcf.condition.greaterThan.error.maxValue':
-                                       $errorMessage = WCF::getLanguage()->getDynamicVariable($this->errorMessage, array(
+                                       $errorMessage = WCF::getLanguage()->getDynamicVariable($this->errorMessage, [
                                                'maxValue' => $this->maxValue - 1
-                                       ));
+                                       ]);
                                break;
                                
                                case 'wcf.condition.lessThan.error.maxValue':
-                                       $errorMessage = WCF::getLanguage()->getDynamicVariable($this->errorMessage, array(
+                                       $errorMessage = WCF::getLanguage()->getDynamicVariable($this->errorMessage, [
                                                'maxValue' => $this->maxValue
-                                       ));
+                                       ]);
                                break;
                                
                                case 'wcf.condition.greaterThan.error.minValue':
-                                       $errorMessage = WCF::getLanguage()->getDynamicVariable($this->errorMessage, array(
+                                       $errorMessage = WCF::getLanguage()->getDynamicVariable($this->errorMessage, [
                                                'minValue' => $this->minValue
-                                       ));
+                                       ]);
                                break;
                                
                                case 'wcf.condition.lessThan.error.minValue':
-                                       $errorMessage = WCF::getLanguage()->getDynamicVariable($this->errorMessage, array(
+                                       $errorMessage = WCF::getLanguage()->getDynamicVariable($this->errorMessage, [
                                                'minValue' => $this->minValue + 1
-                                       ));
+                                       ]);
                                break;
                                
                                default:
@@ -114,7 +114,7 @@ abstract class AbstractIntegerCondition extends AbstractSingleFieldCondition {
        }
        
        /**
-        * @see \wcf\system\condition\AbstractSingleFieldCondition::getFieldElement()
+        * @inheritDoc
         */
        public function getFieldElement() {
                $greaterThanPlaceHolder = WCF::getLanguage()->get('wcf.condition.greaterThan');
@@ -190,7 +190,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::readFormParameters()
+        * @inheritDoc
         */
        public function readFormParameters() {
                if (isset($_POST['lessThan_'.$this->getIdentifier()]) && strlen($_POST['lessThan_'.$this->getIdentifier()])) $this->lessThan = intval($_POST['lessThan_'.$this->getIdentifier()]);
@@ -198,7 +198,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::reset()
+        * @inheritDoc
         */
        public function reset() {
                $this->lessThan = null;
@@ -206,7 +206,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::setData()
+        * @inheritDoc
         */
        public function setData(Condition $condition) {
                $this->lessThan = $condition->lessThan;
@@ -214,7 +214,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::validate()
+        * @inheritDoc
         */
        public function validate() {
                if ($this->lessThan !== null) {
index 9566019205873c249b39a2aa597fad0bf92f2773..fb57986b215ae21bff534208888707907cb6ec7e 100644 (file)
@@ -17,7 +17,7 @@ use wcf\util\ArrayUtil;
 abstract class AbstractMultiSelectCondition extends AbstractSelectCondition {
        /**
         * selected values
-        * @var mixed[]
+        * @var array
         */
        protected $fieldValue = [];
        
index d06885f92101ac2bdca04bffc6712f58701e00cf..f39be359cbe061826b4f747f95d76245d4331bf6 100644 (file)
@@ -6,7 +6,7 @@ use wcf\system\WCF;
  * Abstract implementation of a condition for multiple fields.
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -15,21 +15,21 @@ use wcf\system\WCF;
 abstract class AbstractMultipleFieldsCondition extends AbstractCondition {
        /**
         * language items of the input element descriptions
-        * @var string
+        * @var string[]
         */
-       protected $descriptions = array();
+       protected $descriptions = [];
        
        /**
         * error messages if the validation failed
-        * @var string
+        * @var string[]
         */
-       protected $errorMessages = array();
+       protected $errorMessages = [];
        
        /**
         * language items of the input element labels
-        * @var string
+        * @var string[]
         */
-       protected $labels = array();
+       protected $labels = [];
        
        /**
         * Returns the description element for the HTML output.
index 33c73b1ec05fa61db2a60a205f3579669d6fcfcb..f0c165b01e11211c2227040d05322b27e8afe4bb 100644 (file)
@@ -2,13 +2,14 @@
 namespace wcf\system\condition;
 use wcf\data\DatabaseObject;
 use wcf\data\DatabaseObjectList;
+use wcf\system\exception\InvalidArgumentException;
 
 /**
  * Abstract condition implementation for check a text-typed property of a database
  * object.
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -36,11 +37,13 @@ abstract class AbstractObjectTextPropertyCondition extends AbstractTextCondition
        protected $propertyName = '';
        
        /**
-        * @see \wcf\system\condition\IObjectListCondition::addObjectListCondition()
+        * @inheritDoc
         */
        public function addObjectListCondition(DatabaseObjectList $objectList, array $conditionData) {
                $className = $this->getListClassName();
-               if (!($objectList instanceof $className)) return;
+               if (!($objectList instanceof $className)) {
+                       throw new InvalidArgumentException("Object list is no instance of '{$className}', instance of '".get_class($objectList)."' given.");
+               }
                
                if ($this->supportsMultipleValues) {
                        $objectList->getConditionBuilder()->add($objectList->getDatabaseTableAlias().'.'.$this->getPropertyName().' IN (?)', [$conditionData[$this->fieldName]]);
@@ -51,7 +54,7 @@ abstract class AbstractObjectTextPropertyCondition extends AbstractTextCondition
        }
        
        /**
-        * @see \wcf\system\condition\IObjectCondition::checkObject()
+        * @inheritDoc
         */
        public function checkObject(DatabaseObject $object, array $conditionData) {
                $className = $this->getClassName();
@@ -70,7 +73,7 @@ abstract class AbstractObjectTextPropertyCondition extends AbstractTextCondition
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::getData()
+        * @inheritDoc
         */
        public function getData() {
                $value = parent::getData();
index ba8ded0b49db59b9ec0f41f01b740790bf5f4f3c..6653204a5372e5f171048415b3a1d6f7cd9b9e0b 100644 (file)
@@ -78,7 +78,7 @@ abstract class AbstractSingleFieldCondition extends AbstractCondition implements
        abstract protected function getFieldElement();
        
        /**
-        * @see \wcf\system\condition\ICondition::getHTML()
+        * @inheritDoc
         */
        public function getHTML() {
                return <<<HTML
index 4caaa3acf1ed627814ed36db66eaeb2964f846ca..6da75a4ee9011d63730deb382474efea2d4a4a33 100644 (file)
@@ -7,7 +7,7 @@ use wcf\util\StringUtil;
  * Abstract implementation of a text condition.
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -27,41 +27,39 @@ abstract class AbstractTextCondition extends AbstractSingleFieldCondition {
        protected $fieldValue = '';
        
        /**
-        * @see \wcf\system\condition\ICondition::getData()
+        * @inheritDoc
         */
        public function getData() {
                if (mb_strlen($this->fieldValue)) {
-                       return [
-                               $this->fieldName => $this->fieldValue
-                       ];
+                       return [$this->fieldName => $this->fieldValue];
                }
                
                return null;
        }
        
        /**
-        * @see \wcf\system\condition\AbstractSingleFieldCondition::getFieldElement()
+        * @inheritDoc
         */
        protected function getFieldElement() {
                return '<input type="text" name="'.$this->fieldName.'" value="'.StringUtil::encodeHTML($this->fieldValue).'" class="long" />';
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::readFormParameters()
+        * @inheritDoc
         */
        public function readFormParameters() {
                if (isset($_POST[$this->fieldName])) $this->fieldValue = StringUtil::trim($_POST[$this->fieldName]);
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::reset()
+        * @inheritDoc
         */
        public function reset() {
                $this->fieldValue = '';
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::setData()
+        * @inheritDoc
         */
        public function setData(Condition $condition) {
                $this->fieldValue = $condition->conditionData[$this->fieldName];
index 34208c7ac49d51a289564d2756dc815a94171fd6..4fe0c4895f3687db85ebd412bdcb31e88725f590 100644 (file)
@@ -3,6 +3,7 @@ namespace wcf\system\condition;
 use wcf\data\condition\Condition;
 use wcf\data\DatabaseObject;
 use wcf\data\DatabaseObjectList;
+use wcf\system\exception\InvalidArgumentException;
 use wcf\system\exception\UserInputException;
 use wcf\system\WCF;
 
@@ -44,11 +45,13 @@ abstract class AbstractTimestampCondition extends AbstractSingleFieldCondition i
        protected $startTime = '';
        
        /**
-        * @see \wcf\system\condition\IObjectListCondition::addObjectListCondition()
+        * @inheritDoc
         */
        public function addObjectListCondition(DatabaseObjectList $objectList, array $conditionData) {
                $className = $this->getListClassName();
-               if (!($objectList instanceof $className)) return;
+               if (!($objectList instanceof $className)) {
+                       throw new InvalidArgumentException("Object list is no instance of '{$className}', instance of '".get_class($objectList)."' given.");
+               }
                
                $objectList->getConditionBuilder()->add($objectList->getDatabaseTableAlias().'.'.$this->getPropertyName().' <> ?', [0]);
                if (isset($conditionData['endTime'])) {
@@ -60,7 +63,7 @@ abstract class AbstractTimestampCondition extends AbstractSingleFieldCondition i
        }
        
        /**
-        * @see \wcf\system\condition\IObjectCondition::checkObject()
+        * @inheritDoc
         */
        public function checkObject(DatabaseObject $object, array $conditionData) {
                $className = $this->getClassName();
@@ -86,10 +89,10 @@ abstract class AbstractTimestampCondition extends AbstractSingleFieldCondition i
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::getData()
+        * @inheritDoc
         */
        public function getData() {
-               $data = array();
+               $data = [];
                
                if (strlen($this->startTime)) {
                        $data['startTime'] = $this->startTime;
@@ -106,7 +109,7 @@ abstract class AbstractTimestampCondition extends AbstractSingleFieldCondition i
        }
        
        /**
-        * @see \wcf\system\condition\AbstractSingleFieldCondition::getFieldElement()
+        * @inheritDoc
         */
        protected function getFieldElement() {
                $start = WCF::getLanguage()->get('wcf.date.period.start');
@@ -119,7 +122,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\AbstractSingleFieldCondition::getLabel()
+        * @inheritDoc
         */
        protected function getLabel() {
                return WCF::getLanguage()->get($this->getLanguageItemPrefix().'.'.$this->getPropertyName());
@@ -151,7 +154,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::readFormParameters()
+        * @inheritDoc
         */
        public function readFormParameters() {
                if (isset($_POST[$this->getPropertyName().'EndTime'])) $this->endTime = $_POST[$this->getPropertyName().'EndTime'];
@@ -159,7 +162,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::reset()
+        * @inheritDoc
         */
        public function reset() {
                $this->endTime = '';
@@ -167,7 +170,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::setData()
+        * @inheritDoc
         */
        public function setData(Condition $condition) {
                if ($condition->endTime) {
@@ -179,7 +182,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::validate()
+        * @inheritDoc
         */
        public function validate() {
                $endTime = $startTime = null;
index 699d96769976ed1b267cbbea55acf561b3106661..a3f4db9ca2f8c7b94649deed11c6b84598cddb69 100644 (file)
@@ -8,7 +8,7 @@ use wcf\util\DateUtil;
  * Condition implementation for the days of the week.
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -16,25 +16,25 @@ use wcf\util\DateUtil;
  */
 class DaysOfWeekCondition extends AbstractMultiSelectCondition implements IContentCondition {
        /**
-        * @see \wcf\system\condition\AbstractSingleFieldCondition::$label
+        * @inheritDoc
         */
        protected $description = 'wcf.global.multiSelect';
        
        /**
-        * @see wcf\system\condition\AbstractSelectCondition::$fieldName
+        * @inheritDoc
         */
        protected $fieldName = 'daysOfWeek';
        
        /**
-        * @see \wcf\system\condition\AbstractSingleFieldCondition::$label
+        * @inheritDoc
         */
        protected $label = 'wcf.date.daysOfWeek';
        
        /**
-        * @see \wcf\system\condition\AbstractSelectCondition::getOptions()
+        * @inheritDoc
         */
        protected function getOptions() {
-               $options = array();
+               $options = [];
                
                $daysOfWeek = DateUtil::getWeekDays();
                foreach ($daysOfWeek as $index => $day) {
@@ -45,7 +45,7 @@ class DaysOfWeekCondition extends AbstractMultiSelectCondition implements IConte
        }
        
        /**
-        * @see \wcf\system\condition\IContentCondition::showContent()
+        * @inheritDoc
         */
        public function showContent(Condition $condition) {
                $date = DateUtil::getDateTimeByTimestamp(TIME_NOW);
index 545741e5aae58b4c9e28df1aded80158a54a10dd..6081ced9984bfb220e8402476fc13a26f567a5a2 100644 (file)
@@ -6,7 +6,7 @@ use wcf\data\condition\Condition;
  * Every implementation for content conditions needs to implements this interface.
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -19,7 +19,7 @@ interface IContentCondition extends ICondition {
         * All necessary data to check the condition needs to be globally available
         * like the active user object via WCF::getUser().
         * 
-        * @param       \wcf\data\condition\Condition   $condition
+        * @param       Condition       $condition
         * @return      boolean
         */
        public function showContent(Condition $condition);
index 3077be426e875a633fae7a8ec51bba47fbcc5e90..527110eb35941fa684309528247f21580c4f9da3 100644 (file)
@@ -7,7 +7,7 @@ use wcf\data\DatabaseObject;
  * this interface.
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -19,8 +19,8 @@ interface IObjectCondition extends ICondition {
         * Returns true if the given object fulfills the condition specified by
         * the given condition data returned by \wcf\system\condition\ICondition::getData().
         * 
-        * @param       \wcf\data\DatabaseObject        $object
-        * @param       array                           $conditionData
+        * @param       DatabaseObject  $object
+        * @param       array           $conditionData
         * @return      boolean
         */
        public function checkObject(DatabaseObject $object, array $conditionData);
index 79d44cd24461a23b1309f82d3277bf09381f7c7c..cd3029b9e91e6afd062809aa1d3a8b3c0d6e1379 100644 (file)
@@ -19,8 +19,8 @@ interface IObjectListCondition extends ICondition {
         * Adds a condition to the given object list based on the given condition
         * data returned by \wcf\system\condition\ICondition::getData().
         * 
-        * @param       \wcf\data\DatabaseObjectList    $objectList
-        * @param       array                           $conditionData
+        * @param       DatabaseObjectList      $objectList
+        * @param       array                   $conditionData
         */
        public function addObjectListCondition(DatabaseObjectList $objectList, array $conditionData);
 }
index 5fc328c349db77c0d987a027938ff3df8c67376f..eb417cec693e43c90250bd96f2fbbf338100da2b 100644 (file)
@@ -8,7 +8,7 @@ use wcf\data\user\UserList;
  * Every implementation for user conditions needs to implements this interface.
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -19,16 +19,16 @@ interface IUserCondition extends ICondition {
         * Adds the condition to the given user list to fetch the users which fulfill
         * the given condition.
         * 
-        * @param       \wcf\data\condition\Condition   $condition
-        * @param       \wcf\data\user\UserList         $userList
+        * @param       Condition       $condition
+        * @param       UserList        $userList
         */
        public function addUserCondition(Condition $condition, UserList $userList);
        
        /**
         * Returns true if the given user fulfills the given condition.
         * 
-        * @param       \wcf\data\condition\Condition   $condition
-        * @param       \wcf\data\user\User             $user
+        * @param       Condition       $condition
+        * @param       User            $user
         * @return      boolean
         */
        public function checkUser(Condition $condition, User $user);
index 7b7d3451c3c7b76ace02e8f50fc241420ed739b1..63e08889f02e7d1c57d9cb30d51ef7173b4b82ed 100644 (file)
@@ -8,7 +8,7 @@ use wcf\data\user\UserList;
  * IObjectListCondition::addObjectListCondition().
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -17,7 +17,7 @@ use wcf\data\user\UserList;
  */
 trait TObjectListUserCondition {
        /**
-        * @see \wcf\system\condition\IUserCondition::addUserCondition()
+        * @inheritDoc
         */
        public function addUserCondition(Condition $condition, UserList $userList) {
                $this->addObjectListCondition($userList, $condition->conditionData);
index f27419ea3321a7fe7f643bb4ce60e43ed6f1011c..8f2afea58acc1b76e620fda4c7403a2bd19ba5a6 100644 (file)
@@ -7,7 +7,7 @@ use wcf\data\user\User;
  * Redirects IUserCondition::checkUser() calls to the more general IObjectCondition::checkObject().
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -16,7 +16,7 @@ use wcf\data\user\User;
  */
 trait TObjectUserCondition {
        /**
-        * @see \wcf\system\condition\IUserCondition::checkUser()
+        * @inheritDoc
         */
        public function checkUser(Condition $condition, User $user) {
                $this->checkObject($user, $condition->conditionData);
index ce988158d7dfcc313fd7c725837a83ccf6ec78f9..fc8c94a79c0cb5d1d6a484f8d9297539ede59c07 100644 (file)
@@ -10,7 +10,7 @@ use wcf\util\StringUtil;
  * Condition implementation for the current time.
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -24,12 +24,12 @@ class TimeCondition extends AbstractMultipleFieldsCondition implements IContentC
        protected $endTime = '00:00';
        
        /**
-        * @see \wcf\system\condition\AbstractMultipleFieldsCondition::$label
+        * @inheritDoc
         */
-       protected $labels = array(
+       protected $labels = [
                'time' => 'wcf.date.time',
                'timezone' => 'wcf.date.timezone'
-       );
+       ];
        
        /**
         * start time
@@ -44,10 +44,10 @@ class TimeCondition extends AbstractMultipleFieldsCondition implements IContentC
        protected $timezone = 0;
        
        /**
-        * @see \wcf\system\condition\ICondition::getData()
+        * @inheritDoc
         */
        public function getData() {
-               $data = array();
+               $data = [];
                
                if ($this->startTime) {
                        $data['startTime'] = $this->startTime;
@@ -68,7 +68,7 @@ class TimeCondition extends AbstractMultipleFieldsCondition implements IContentC
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::getHTML()
+        * @inheritDoc
         */
        public function getHTML() {
                $start = WCF::getLanguage()->get('wcf.date.period.start');
@@ -111,7 +111,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::readFormParameters()
+        * @inheritDoc
         */
        public function readFormParameters() {
                if (isset($_POST['endTime'])) $this->endTime = StringUtil::trim($_POST['endTime']);
@@ -120,7 +120,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::reset()
+        * @inheritDoc
         */
        public function reset() {
                $this->endTime = '00:00';
@@ -129,7 +129,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::setData()
+        * @inheritDoc
         */
        public function setData(Condition $condition) {
                if ($condition->endTime) {
@@ -144,7 +144,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::validate()
+        * @inheritDoc
         */
        public function validate() {
                if ($this->startTime == '00:00' && $this->endTime == '00:00') {
@@ -186,7 +186,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\IContentCondition::showContent()
+        * @inheritDoc
         */
        public function showContent(Condition $condition) {
                $timezone = WCF::getUser()->getTimeZone();
index 57bcd4b0905c1cba53cf93826c83a969127b574c..023095dc1869418048b922ed6d9c54f1b614dcdc 100644 (file)
@@ -4,13 +4,14 @@ use wcf\data\condition\Condition;
 use wcf\data\user\User;
 use wcf\data\user\UserList;
 use wcf\data\DatabaseObjectList;
+use wcf\system\exception\InvalidArgumentException;
 use wcf\system\WCF;
 
 /**
  * Condition implementation for the avatar of a user.
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -20,12 +21,12 @@ class UserAvatarCondition extends AbstractSelectCondition implements IContentCon
        use TObjectListUserCondition;
        
        /**
-        * @see wcf\system\condition\AbstractSelectCondition::$fieldName
+        * @inheritDoc
         */
        protected $fieldName = 'userAvatar';
        
        /**
-        * @see \wcf\system\condition\AbstractSingleFieldCondition::$label
+        * @inheritDoc
         */
        protected $label = 'wcf.user.condition.avatar';
        
@@ -48,15 +49,17 @@ class UserAvatarCondition extends AbstractSelectCondition implements IContentCon
        const GRAVATAR = 2;
        
        /**
-        * @see \wcf\system\condition\IObjectListCondition::addObjectListCondition()
+        * @inheritDoc
         */
        public function addObjectListCondition(DatabaseObjectList $objectList, array $conditionData) {
-               if (!($objectList instanceof UserList)) return;
+               if (!($objectList instanceof UserList)) {
+                       throw new InvalidArgumentException("Object list is no instance of '".UserList::class."', instance of '".get_class($objectList)."' given.");
+               }
                
                switch ($conditionData['userAvatar']) {
                        case self::NO_AVATAR:
                                $objectList->getConditionBuilder()->add('user_table.avatarID IS NULL');
-                               $objectList->getConditionBuilder()->add('user_table.enableGravatar = ?', array(0));
+                               $objectList->getConditionBuilder()->add('user_table.enableGravatar = ?', [0]);
                        break;
                        
                        case self::AVATAR:
@@ -64,13 +67,13 @@ class UserAvatarCondition extends AbstractSelectCondition implements IContentCon
                        break;
                        
                        case self::GRAVATAR:
-                               $objectList->getConditionBuilder()->add('user_table.enableGravatar = ?', array(1));
+                               $objectList->getConditionBuilder()->add('user_table.enableGravatar = ?', [1]);
                        break;
                }
        }
        
        /**
-        * @see \wcf\system\condition\IUserCondition::checkUser()
+        * @inheritDoc
         */
        public function checkUser(Condition $condition, User $user) {
                switch ($condition->userAvatar) {
@@ -89,19 +92,19 @@ class UserAvatarCondition extends AbstractSelectCondition implements IContentCon
        }
        
        /**
-        * @see \wcf\system\condition\AbstractSelectCondition::getOptions()
+        * @inheritDoc
         */
        protected function getOptions() {
-               return array(
+               return [
                        self::NO_SELECTION_VALUE => 'wcf.global.noSelection',
                        self::NO_AVATAR => 'wcf.user.condition.avatar.noAvatar',
                        self::AVATAR => 'wcf.user.condition.avatar.avatar',
                        self::GRAVATAR => 'wcf.user.condition.avatar.gravatar'
-               );
+               ];
        }
        
        /**
-        * @see \wcf\system\condition\IContentCondition::showContent()
+        * @inheritDoc
         */
        public function showContent(Condition $condition) {
                if (!WCF::getUser()->userID) return false;
index ae46b3630c42e567c1f72c01a64ccc1beae37c03..d60187b2c510b863ef79a0d8cc1f0c01694581a4 100644 (file)
@@ -8,7 +8,7 @@ use wcf\system\WCF;
  * Condition implementation if it is the active user's birthday today.
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -22,20 +22,18 @@ class UserBirthdayCondition extends AbstractCondition implements IContentConditi
        protected $birthdayToday = 0;
        
        /**
-        * @see \wcf\system\condition\ICondition::getData()
+        * @inheritDoc
         */
        public function getData() {
                if ($this->birthdayToday) {
-                       return array(
-                               'birthdayToday' => 1
-                       );
+                       return ['birthdayToday' => 1];
                }
                
                return null;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::getHTML()
+        * @inheritDoc
         */
        public function getHTML() {
                $label = WCF::getLanguage()->get('wcf.user.birthdayToday');
@@ -55,28 +53,28 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::readFormParameters()
+        * @inheritDoc
         */
        public function readFormParameters() {
                if (isset($_POST['birthdayToday'])) $this->birthdayToday = 1;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::reset()
+        * @inheritDoc
         */
        public function reset() {
                $this->birthdayToday = 0;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::readFormParameters()
+        * @inheritDoc
         */
        public function setData(Condition $condition) {
                $this->birthdayToday = $condition->birthdayToday;
        }
        
        /**
-        * @see \wcf\system\condition\IContentCondition::showContent()
+        * @inheritDoc
         */
        public function showContent(Condition $condition) {
                if (!WCF::getUser()->userID) return false;
index 0413e4769923e51505d49d6a5798ef51cbcf8f67..5f2307b17f8876444cb73b2b3f2ad2ca61f30f61 100644 (file)
@@ -4,13 +4,14 @@ use wcf\data\condition\Condition;
 use wcf\data\user\User;
 use wcf\data\user\UserList;
 use wcf\data\DatabaseObjectList;
+use wcf\system\exception\InvalidArgumentException;
 use wcf\system\WCF;
 
 /**
  * Condition implementation for the email address of a user.
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -20,33 +21,35 @@ class UserEmailCondition extends AbstractTextCondition implements IContentCondit
        use TObjectListUserCondition;
        
        /**
-        * @see \wcf\system\condition\AbstractTextCondition::$fieldName
+        * @inheritDoc
         */
        protected $fieldName = 'email';
        
        /**
-        * @see \wcf\system\condition\AbstractSingleFieldCondition::$label
+        * @inheritDoc
         */
        protected $label = 'wcf.user.email';
        
        /**
-        * @see \wcf\system\condition\IObjectListCondition::addObjectListCondition()
+        * @inheritDoc
         */
        public function addObjectListCondition(DatabaseObjectList $objectList, array $conditionData) {
-               if (!($objectList instanceof UserList)) return;
+               if (!($objectList instanceof UserList)) {
+                       throw new InvalidArgumentException("Object list is no instance of '".UserList::class."', instance of '".get_class($objectList)."' given.");
+               }
                
-               $objectList->getConditionBuilder()->add('user_table.email LIKE ?', array('%'.addcslashes($conditionData['email'], '_%').'%'));
+               $objectList->getConditionBuilder()->add('user_table.email LIKE ?', ['%'.addcslashes($conditionData['email'], '_%').'%']);
        }
        
        /**
-        * @see \wcf\system\condition\IUserCondition::checkUser()
+        * @inheritDoc
         */
        public function checkUser(Condition $condition, User $user) {
                return mb_strpos($user->email, $condition->email) !== false;
        }
        
        /**
-        * @see \wcf\system\condition\IContentCondition::showContent()
+        * @inheritDoc
         */
        public function showContent(Condition $condition) {
                if (!WCF::getUser()->userID) return false;
index 08ce692aa148f0781b66742fb95af6af91c61cd2..9913a65f141f2a217870ab24c085a31d00d7fb52 100644 (file)
@@ -5,6 +5,7 @@ use wcf\data\user\group\UserGroup;
 use wcf\data\user\User;
 use wcf\data\user\UserList;
 use wcf\data\DatabaseObjectList;
+use wcf\system\exception\InvalidArgumentException;
 use wcf\system\exception\UserInputException;
 use wcf\system\WCF;
 use wcf\util\ArrayUtil;
@@ -14,7 +15,7 @@ use wcf\util\ArrayUtil;
  * of and the user groups a user may not be a member of.
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -24,55 +25,57 @@ class UserGroupCondition extends AbstractMultipleFieldsCondition implements ICon
        use TObjectListUserCondition;
        
        /**
-        * @see \wcf\system\condition\AbstractMultipleFieldsCondition::$descriptions
+        * @inheritDoc
         */
-       protected $descriptions = array(
+       protected $descriptions = [
                'groupIDs' => 'wcf.user.condition.groupIDs.description',
                'notGroupIDs' => 'wcf.user.condition.notGroupIDs.description'
-       );
+       ];
        
        /**
         * ids of the selected user groups the user has to be member of
         * @var integer[]
         */
-       protected $groupIDs = array();
+       protected $groupIDs = [];
        
        /**
-        * @see \wcf\system\condition\AbstractMultipleFieldsCondition::$labels
+        * @inheritDoc
         */
-       protected $labels = array(
+       protected $labels = [
                'groupIDs' => 'wcf.user.condition.groupIDs',
                'notGroupIDs' => 'wcf.user.condition.notGroupIDs'
-       );
+       ];
        
        /**
         * ids of the selected user groups the user may not be member of
         * @var integer[]
         */
-       protected $notGroupIDs = array();
+       protected $notGroupIDs = [];
        
        /**
         * selectable user groups
         * @var UserGroup[]
         */
-       protected $userGroups = null;
+       protected $userGroups;
        
        /**
-        * @see \wcf\system\condition\IObjectListCondition::addObjectListCondition()
+        * @inheritDoc
         */
        public function addObjectListCondition(DatabaseObjectList $objectList, array $conditionData) {
-               if (!($objectList instanceof UserList)) return;
+               if (!($objectList instanceof UserList)) {
+                       throw new InvalidArgumentException("Object list is no instance of '".UserList::class."', instance of '".get_class($objectList)."' given.");
+               }
                
                if (isset($conditionData['groupIDs'])) {
-                       $objectList->getConditionBuilder()->add('user_table.userID IN (SELECT userID FROM wcf'.WCF_N.'_user_to_group WHERE groupID IN (?) GROUP BY userID HAVING COUNT(userID) = ?)', array($conditionData['groupIDs'], count($conditionData['groupIDs'])));
+                       $objectList->getConditionBuilder()->add('user_table.userID IN (SELECT userID FROM wcf'.WCF_N.'_user_to_group WHERE groupID IN (?) GROUP BY userID HAVING COUNT(userID) = ?)', [$conditionData['groupIDs'], count($conditionData['groupIDs'])]);
                }
                if (isset($conditionData['notGroupIDs'])) {
-                       $objectList->getConditionBuilder()->add('user_table.userID NOT IN (SELECT userID FROM wcf'.WCF_N.'_user_to_group WHERE groupID IN (?))', array($conditionData['notGroupIDs']));
+                       $objectList->getConditionBuilder()->add('user_table.userID NOT IN (SELECT userID FROM wcf'.WCF_N.'_user_to_group WHERE groupID IN (?))', [$conditionData['notGroupIDs']]);
                }
        }
        
        /**
-        * @see \wcf\system\condition\IUserCondition::checkUser()
+        * @inheritDoc
         */
        public function checkUser(Condition $condition, User $user) {
                $groupIDs = $user->getGroupIDs();
@@ -88,10 +91,10 @@ class UserGroupCondition extends AbstractMultipleFieldsCondition implements ICon
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::getData()
+        * @inheritDoc
         */
        public function getData() {
-               $data = array();
+               $data = [];
                
                if (!empty($this->groupIDs)) {
                        $data['groupIDs'] = $this->groupIDs;
@@ -108,7 +111,7 @@ class UserGroupCondition extends AbstractMultipleFieldsCondition implements ICon
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::getHTML()
+        * @inheritDoc
         */
        public function getHTML() {
                return <<<HTML
@@ -155,15 +158,15 @@ HTML;
         */
        protected function getUserGroups() {
                if ($this->userGroups == null) {
-                       $invalidGroupTypes = array(
+                       $invalidGroupTypes = [
                                UserGroup::EVERYONE,
                                UserGroup::USERS
-                       );
+                       ];
                        if (!$this->includeguests) {
                                $invalidGroupTypes[] = UserGroup::GUESTS;
                        }
                        
-                       $this->userGroups = UserGroup::getAccessibleGroups(array(), $invalidGroupTypes);
+                       $this->userGroups = UserGroup::getAccessibleGroups([], $invalidGroupTypes);
                        
                        uasort($this->userGroups, function(UserGroup $groupA, UserGroup $groupB) {
                                return strcmp($groupA->getName(), $groupB->getName());
@@ -174,7 +177,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::readFormParameters()
+        * @inheritDoc
         */
        public function readFormParameters() {
                if (isset($_POST['groupIDs'])) $this->groupIDs = ArrayUtil::toIntegerArray($_POST['groupIDs']);
@@ -182,15 +185,15 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::reset()
+        * @inheritDoc
         */
        public function reset() {
-               $this->groupIDs = array();
-               $this->notGroupIDs = array();
+               $this->groupIDs = [];
+               $this->notGroupIDs = [];
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::setData()
+        * @inheritDoc
         */
        public function setData(Condition $condition) {
                if ($condition->groupIDs !== null) {
@@ -211,7 +214,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::validate()
+        * @inheritDoc
         */
        public function validate() {
                $userGroups = $this->getUserGroups();
@@ -238,7 +241,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\IContentCondition::showContent()
+        * @inheritDoc
         */
        public function showContent(Condition $condition) {
                return $this->checkUser($condition, WCF::getUser());
index 3f9e74aef072028bf15bbc01281ff53614aaf705..005dfb43f7407e568b0a35f64ebe11147e471a0b 100644 (file)
@@ -4,13 +4,14 @@ use wcf\data\condition\Condition;
 use wcf\data\user\User;
 use wcf\data\user\UserList;
 use wcf\data\DatabaseObjectList;
+use wcf\system\exception\InvalidArgumentException;
 use wcf\system\WCF;
 
 /**
  * Condition implementation for an integer property of a user.
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -20,21 +21,23 @@ class UserIntegerPropertyCondition extends AbstractIntegerCondition implements I
        use TObjectListUserCondition;
        
        /**
-        * @see \wcf\system\condition\IObjectListCondition::addObjectListCondition()
+        * @inheritDoc
         */
        public function addObjectListCondition(DatabaseObjectList $objectList, array $conditionData) {
-               if (!($objectList instanceof UserList)) return;
+               if (!($objectList instanceof UserList)) {
+                       throw new InvalidArgumentException("Object list is no instance of '".UserList::class."', instance of '".get_class($objectList)."' given.");
+               }
                
                if (isset($conditionData['greaterThan'])) {
-                       $objectList->getConditionBuilder()->add('user_table.'.$this->getDecoratedObject()->propertyname.' > ?', array($conditionData['greaterThan']));
+                       $objectList->getConditionBuilder()->add('user_table.'.$this->getDecoratedObject()->propertyname.' > ?', [$conditionData['greaterThan']]);
                }
                if (isset($conditionData['lessThan'])) {
-                       $objectList->getConditionBuilder()->add('user_table.'.$this->getDecoratedObject()->propertyname.' < ?', array($conditionData['lessThan']));
+                       $objectList->getConditionBuilder()->add('user_table.'.$this->getDecoratedObject()->propertyname.' < ?', [$conditionData['lessThan']]);
                }
        }
        
        /**
-        * @see \wcf\system\condition\IUserCondition::checkUser()
+        * @inheritDoc
         */
        public function checkUser(Condition $condition, User $user) {
                if ($condition->greaterThan !== null && $user->{$this->getDecoratedObject()->propertyname} <= $condition->greaterThan) {
@@ -48,21 +51,21 @@ class UserIntegerPropertyCondition extends AbstractIntegerCondition implements I
        }
        
        /**
-        * @see \wcf\system\condition\AbstractIntegerCondition::getIdentifier()
+        * @inheritDoc
         */
        protected function getIdentifier() {
                return 'user_'.$this->getDecoratedObject()->propertyname;
        }
        
        /**
-        * @see \wcf\system\condition\AbstractSingleFieldCondition::getLabel()
+        * @inheritDoc
         */
        protected function getLabel() {
                return WCF::getLanguage()->get('wcf.user.condition.'.$this->getDecoratedObject()->propertyname);
        }
        
        /**
-        * @see \wcf\system\condition\IContentCondition::showContent()
+        * @inheritDoc
         */
        public function showContent(Condition $condition) {
                if (!WCF::getUser()->userID) return false;
index 07b402e61ccfb953a105abc63b48d344ee4513a2..111685df269bb0d8e5b37b0ad410b136db220204 100644 (file)
@@ -4,6 +4,7 @@ use wcf\data\condition\Condition;
 use wcf\data\user\User;
 use wcf\data\user\UserList;
 use wcf\data\DatabaseObjectList;
+use wcf\system\exception\InvalidArgumentException;
 use wcf\system\exception\UserInputException;
 use wcf\system\language\LanguageFactory;
 use wcf\system\WCF;
@@ -23,7 +24,7 @@ class UserLanguageCondition extends AbstractSingleFieldCondition implements ICon
        use TObjectListUserCondition;
        
        /**
-        * @see \wcf\system\condition\AbstractSingleFieldCondition::$label
+        * @inheritDoc
         */
        protected $label = 'wcf.user.condition.languages';
        
@@ -31,19 +32,21 @@ class UserLanguageCondition extends AbstractSingleFieldCondition implements ICon
         * ids of the selected languages
         * @var integer[]
         */
-       protected $languageIDs = array();
+       protected $languageIDs = [];
        
        /**
-        * @see \wcf\system\condition\IObjectListCondition::addObjectListCondition()
+        * @inheritDoc
         */
        public function addObjectListCondition(DatabaseObjectList $objectList, array $conditionData) {
-               if (!($objectList instanceof UserList)) return;
+               if (!($objectList instanceof UserList)) {
+                       throw new InvalidArgumentException("Object list is no instance of '".UserList::class."', instance of '".get_class($objectList)."' given.");
+               }
                
-               $objectList->getConditionBuilder()->add('user_table.languageID IN (?)', array($conditionData['languageIDs']));
+               $objectList->getConditionBuilder()->add('user_table.languageID IN (?)', [$conditionData['languageIDs']]);
        }
        
        /**
-        * @see \wcf\system\condition\IUserCondition::checkUser()
+        * @inheritDoc
         */
        public function checkUser(Condition $condition, User $user) {
                if (!empty($condition->conditionData['languageIDs']) && !in_array($user->languageID, $condition->languageIDs)) {
@@ -54,20 +57,20 @@ class UserLanguageCondition extends AbstractSingleFieldCondition implements ICon
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::getData()
+        * @inheritDoc
         */
        public function getData() {
                if (!empty($this->languageIDs)) {
-                       return array(
+                       return [
                                'languageIDs' => $this->languageIDs
-                       );
+                       ];
                }
                
                return null;
        }
        
        /**
-        * @see \wcf\system\condition\AbstractSingleFieldCondition::getFieldElement()
+        * @inheritDoc
         */
        protected function getFieldElement() {
                $returnValue = "";
@@ -79,21 +82,21 @@ class UserLanguageCondition extends AbstractSingleFieldCondition implements ICon
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::readFormParameters()
+        * @inheritDoc
         */
        public function readFormParameters() {
                if (isset($_POST['languageIDs']) && is_array($_POST['languageIDs'])) $this->languageIDs = ArrayUtil::toIntegerArray($_POST['languageIDs']);
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::reset()
+        * @inheritDoc
         */
        public function reset() {
-               $this->languageIDs = array();
+               $this->languageIDs = [];
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::setData()
+        * @inheritDoc
         */
        public function setData(Condition $condition) {
                if (!empty($condition->conditionData['languageIDs'])) {
@@ -102,7 +105,7 @@ class UserLanguageCondition extends AbstractSingleFieldCondition implements ICon
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::validate()
+        * @inheritDoc
         */
        public function validate() {
                foreach ($this->languageIDs as $languageID) {
@@ -115,7 +118,7 @@ class UserLanguageCondition extends AbstractSingleFieldCondition implements ICon
        }
        
        /**
-        * @see \wcf\system\condition\IContentCondition::showContent()
+        * @inheritDoc
         */
        public function showContent(Condition $condition) {
                if (WCF::getUser()->userID) {
index 08c25ee9f2e1356c6c849350de506201ac0582d0..af3cc7be650e1683249d908b7819c2f9398e90c1 100644 (file)
@@ -9,7 +9,7 @@ use wcf\util\UserUtil;
  * Condition implementation if it is the active user uses a mobile browser.
  * 
  * @author     Joshua Ruesweg, Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -17,7 +17,7 @@ use wcf\util\UserUtil;
  */
 class UserMobileBrowserCondition extends AbstractSingleFieldCondition implements IContentCondition {
        /**
-        * @see \wcf\system\condition\AbstractSingleFieldCondition::$label
+        * @inheritDoc
         */
        protected $label = 'wcf.user.condition.mobileBrowser';
        
@@ -34,22 +34,22 @@ class UserMobileBrowserCondition extends AbstractSingleFieldCondition implements
        protected $usesNoMobileBrowser = 0;
        
        /**
-        * @see \wcf\system\condition\ICondition::getData()
+        * @inheritDoc
         */
        public function getData() {
                if ($this->usesMobileBrowser || $this->usesNoMobileBrowser) {
-                       return array(
+                       return [
                                // if notUseMobileBrowser is selected usesMobileBrowser is 0
                                // otherwise notUseMobileBrowser is 1
                                'usesMobileBrowser' => $this->usesMobileBrowser
-                       );
+                       ];
                }
                
                return null;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::getHTML()
+        * @inheritDoc
         */
        public function getFieldElement() {
                $usesMobileBrowserLabel = WCF::getLanguage()->get('wcf.user.condition.mobileBrowser.usesMobileBrowser');
@@ -71,7 +71,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::readFormParameters()
+        * @inheritDoc
         */
        public function readFormParameters() {
                if (isset($_POST['usesMobileBrowser'])) $this->usesMobileBrowser = 1;
@@ -79,7 +79,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::reset()
+        * @inheritDoc
         */
        public function reset() {
                $this->usesMobileBrowser = 0;
@@ -87,7 +87,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::setData()
+        * @inheritDoc
         */
        public function setData(Condition $condition) {
                $this->usesMobileBrowser = $condition->usesMobileBrowser;
@@ -95,7 +95,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::validate()
+        * @inheritDoc
         */
        public function validate() {
                if ($this->usesMobileBrowser && $this->usesNoMobileBrowser) {
@@ -106,7 +106,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\IContentCondition::showContent()
+        * @inheritDoc
         */
        public function showContent(Condition $condition) {
                return (($condition->usesMobileBrowser && UserUtil::usesMobileBrowser()) || (!$condition->usesMobileBrowser && !UserUtil::usesMobileBrowser()));
index 59ee212e91324953003b9eb2ba5adbb59a5817f5..2584444bc4bed7adc1d68fe7cd59df7c6708a690 100644 (file)
@@ -5,6 +5,7 @@ use wcf\data\user\User;
 use wcf\data\user\UserList;
 use wcf\data\DatabaseObject;
 use wcf\data\DatabaseObjectList;
+use wcf\system\exception\InvalidArgumentException;
 use wcf\system\option\user\UserOptionHandler;
 use wcf\system\WCF;
 
@@ -12,7 +13,7 @@ use wcf\system\WCF;
  * Condition implementation for the options of a user.
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -23,12 +24,12 @@ class UserOptionsCondition extends AbstractMultipleFieldsCondition implements IC
        
        /**
         * user option handler object
-        * @var \wcf\system\option\user\UserOptionHandler
+        * @var UserOptionHandler
         */
-       protected $optionHandler = null;
+       protected $optionHandler;
        
        /**
-        * @see \wcf\data\DatabaseObjectDecorator::__construct()
+        * @inheritDoc
         */
        public function __construct(DatabaseObject $object) {
                parent::__construct($object);
@@ -39,10 +40,12 @@ class UserOptionsCondition extends AbstractMultipleFieldsCondition implements IC
        }
        
        /**
-        * @see \wcf\system\condition\IObjectListCondition::addObjectListCondition()
+        * @inheritDoc
         */
        public function addObjectListCondition(DatabaseObjectList $objectList, array $conditionData) {
-               if (!($objectList instanceof UserList)) return;
+               if (!($objectList instanceof UserList)) {
+                       throw new InvalidArgumentException("Object list is no instance of '".UserList::class."', instance of '".get_class($objectList)."' given.");
+               }
                
                $optionValues = $conditionData['optionValues'];
                
@@ -56,7 +59,7 @@ class UserOptionsCondition extends AbstractMultipleFieldsCondition implements IC
        }
        
        /**
-        * @see \wcf\system\condition\IUserCondition::checkUser()
+        * @inheritDoc
         */
        public function checkUser(Condition $condition, User $user) {
                $optionValues = $condition->optionValues;
@@ -77,12 +80,12 @@ class UserOptionsCondition extends AbstractMultipleFieldsCondition implements IC
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::getData()
+        * @inheritDoc
         */
        public function getData() {
                $optionValues = $this->optionHandler->getOptionValues();
                
-               $data = array();
+               $data = [];
                foreach ($this->optionHandler->getCategoryOptions('profile') as $option) {
                        $option = $option['object'];
                        
@@ -95,46 +98,46 @@ class UserOptionsCondition extends AbstractMultipleFieldsCondition implements IC
                }
                
                if (!empty($data)) {
-                       return array(
+                       return [
                                'optionValues' => $data
-                       );
+                       ];
                }
                
                return null;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::getHTML()
+        * @inheritDoc
         */
        public function getHTML() {
-               return WCF::getTPL()->fetch('userOptionsCondition', 'wcf', array(
+               return WCF::getTPL()->fetch('userOptionsCondition', 'wcf', [
                        'optionTree' => $this->optionHandler->getOptionTree('profile')
-               ));
+               ]);
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::readFormParameters()
+        * @inheritDoc
         */
        public function readFormParameters() {
                $this->optionHandler->readUserInput($_POST);
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::reset()
+        * @inheritDoc
         */
        public function reset() {
-               $this->optionHandler->setOptionValues(array());
+               $this->optionHandler->setOptionValues([]);
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::setData()
+        * @inheritDoc
         */
        public function setData(Condition $condition) {
                $this->optionHandler->setOptionValues($condition->conditionData['optionValues']);
        }
        
        /**
-        * @see \wcf\system\condition\IContentCondition::showContent()
+        * @inheritDoc
         */
        public function showContent(Condition $condition) {
                if (!WCF::getUser()->userID) return false;
index 5cdd1d206b117a78bb9d66948294cc2943dbe880..13bbccb14b255ca09bb0e39d46ec11e98ce4d7bc 100644 (file)
@@ -4,6 +4,7 @@ use wcf\data\condition\Condition;
 use wcf\data\user\User;
 use wcf\data\user\UserList;
 use wcf\data\DatabaseObjectList;
+use wcf\system\exception\InvalidArgumentException;
 use wcf\system\exception\UserInputException;
 use wcf\system\WCF;
 
@@ -11,7 +12,7 @@ use wcf\system\WCF;
  * Condition implementation for the registration date of a user.
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -21,7 +22,7 @@ class UserRegistrationDateCondition extends AbstractSingleFieldCondition impleme
        use TObjectListUserCondition;
        
        /**
-        * @see \wcf\system\condition\AbstractSingleFieldCondition::$label
+        * @inheritDoc
         */
        protected $label = 'wcf.user.condition.registrationDate';
        
@@ -38,21 +39,23 @@ class UserRegistrationDateCondition extends AbstractSingleFieldCondition impleme
        protected $registrationDateStart = '';
        
        /**
-        * @see \wcf\system\condition\IObjectListCondition::addObjectListCondition()
+        * @inheritDoc
         */
        public function addObjectListCondition(DatabaseObjectList $objectList, array $conditionData) {
-               if (!($objectList instanceof UserList)) return;
+               if (!($objectList instanceof UserList)) {
+                       throw new InvalidArgumentException("Object list is no instance of '".UserList::class."', instance of '".get_class($objectList)."' given.");
+               }
                
                if (isset($conditionData['registrationDateEnd'])) {
-                       $objectList->getConditionBuilder()->add('user_table.registrationDate < ?', array(strtotime($conditionData['registrationDateEnd']) + 86400));
+                       $objectList->getConditionBuilder()->add('user_table.registrationDate < ?', [strtotime($conditionData['registrationDateEnd']) + 86400]);
                }
                if (isset($conditionData['registrationDateStart'])) {
-                       $objectList->getConditionBuilder()->add('user_table.registrationDate >= ?', array(strtotime($conditionData['registrationDateStart'])));
+                       $objectList->getConditionBuilder()->add('user_table.registrationDate >= ?', [strtotime($conditionData['registrationDateStart'])]);
                }
        }
        
        /**
-        * @see \wcf\system\condition\IUserCondition::checkUser()
+        * @inheritDoc
         */
        public function checkUser(Condition $condition, User $user) {
                if ($condition->registrationDateStart !== null && $user->registrationDate < strtotime($condition->registrationDateStart)) {
@@ -66,10 +69,10 @@ class UserRegistrationDateCondition extends AbstractSingleFieldCondition impleme
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::getData()
+        * @inheritDoc
         */
        public function getData() {
-               $data = array();
+               $data = [];
                
                if (strlen($this->registrationDateStart)) {
                        $data['registrationDateStart'] = $this->registrationDateStart;
@@ -86,7 +89,7 @@ class UserRegistrationDateCondition extends AbstractSingleFieldCondition impleme
        }
        
        /**
-        * @see \wcf\system\condition\AbstractSingleFieldCondition::getFieldElement()
+        * @inheritDoc
         */
        protected function getFieldElement() {
                $start = WCF::getLanguage()->get('wcf.date.period.start');
@@ -99,7 +102,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::readFormParameters()
+        * @inheritDoc
         */
        public function readFormParameters() {
                if (isset($_POST['registrationDateEnd'])) $this->registrationDateEnd = $_POST['registrationDateEnd'];
@@ -107,7 +110,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::reset()
+        * @inheritDoc
         */
        public function reset() {
                $this->registrationDateEnd = '';
@@ -115,7 +118,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::setData()
+        * @inheritDoc
         */
        public function setData(Condition $condition) {
                if ($condition->registrationDateEnd) {
@@ -127,7 +130,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::validate()
+        * @inheritDoc
         */
        public function validate() {
                $registrationDateEnd = $registrationDateStart = null;
@@ -156,7 +159,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\IContentCondition::showContent()
+        * @inheritDoc
         */
        public function showContent(Condition $condition) {
                if (!WCF::getUser()->userID) return false;
index 964bc6650b8295b92c9dd27995b8e720515d4555..99d6a17bef2205233f5878ec7dea8750d05e0282 100644 (file)
@@ -4,6 +4,7 @@ use wcf\data\condition\Condition;
 use wcf\data\user\User;
 use wcf\data\user\UserList;
 use wcf\data\DatabaseObjectList;
+use wcf\system\exception\InvalidArgumentException;
 use wcf\system\WCF;
 
 /**
@@ -11,7 +12,7 @@ use wcf\system\WCF;
  * a user.
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -21,31 +22,33 @@ class UserRegistrationDateIntervalCondition extends AbstractIntegerCondition imp
        use TObjectListUserCondition;
        
        /**
-        * @see \wcf\system\condition\AbstractMultipleFieldsCondition::$languageItemPrefix
+        * @inheritDoc
         */
        protected $label = 'wcf.user.condition.registrationDateInterval';
        
        /**
-        * @see \wcf\system\condition\AbstractIntegerCondition::$minValue
+        * @inheritDoc
         */
        protected $minValue = 0;
        
        /**
-        * @see \wcf\system\condition\IObjectListCondition::addObjectListCondition()
+        * @inheritDoc
         */
        public function addObjectListCondition(DatabaseObjectList $objectList, array $conditionData) {
-               if (!($objectList instanceof UserList)) return;
+               if (!($objectList instanceof UserList)) {
+                       throw new InvalidArgumentException("Object list is no instance of '".UserList::class."', instance of '".get_class($objectList)."' given.");
+               }
                
                if ($conditionData['greaterThan'] !== null) {
-                       $objectList->getConditionBuilder()->add('user_table.registrationDate < ?', array(TIME_NOW - $conditionData['greaterThan'] * 86400));
+                       $objectList->getConditionBuilder()->add('user_table.registrationDate < ?', [TIME_NOW - $conditionData['greaterThan'] * 86400]);
                }
                if ($conditionData['lessThan'] !== null) {
-                       $objectList->getConditionBuilder()->add('user_table.registrationDate > ?', array(TIME_NOW - $conditionData['lessThan'] * 86400));
+                       $objectList->getConditionBuilder()->add('user_table.registrationDate > ?', [TIME_NOW - $conditionData['lessThan'] * 86400]);
                }
        }
        
        /**
-        * @see \wcf\system\condition\IUserCondition::checkUser()
+        * @inheritDoc
         */
        public function checkUser(Condition $condition, User $user) {
                if ($condition->greaterThan !== null && $user->registrationDate >= TIME_NOW - $condition->greaterThan * 86400) {
@@ -59,14 +62,14 @@ class UserRegistrationDateIntervalCondition extends AbstractIntegerCondition imp
        }
        
        /**
-        * @see \wcf\system\condition\AbstractIntegerCondition::getIdentifier()
+        * @inheritDoc
         */
        protected function getIdentifier() {
                return 'user_registrationDateInterval';
        }
        
        /**
-        * @see \wcf\system\condition\IContentCondition::showContent()
+        * @inheritDoc
         */
        public function showContent(Condition $condition) {
                if (!WCF::getUser()->userID) return false;
index 32ab28abb73447f91627472504cd23b6179acaca..fa59fd5222624b411490d8af600e4f4148a18f2a 100644 (file)
@@ -4,6 +4,7 @@ use wcf\data\condition\Condition;
 use wcf\data\user\User;
 use wcf\data\user\UserList;
 use wcf\data\DatabaseObjectList;
+use wcf\system\exception\InvalidArgumentException;
 use wcf\system\exception\UserInputException;
 use wcf\system\WCF;
 
@@ -11,7 +12,7 @@ use wcf\system\WCF;
  * Condition implementation for the state (banned, enabled) of a user.
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -21,7 +22,7 @@ class UserStateCondition extends AbstractSingleFieldCondition implements IConten
        use TObjectListUserCondition;
        
        /**
-        * @see \wcf\system\condition\AbstractSingleFieldCondition::$label
+        * @inheritDoc
         */
        protected $label = 'wcf.user.condition.state';
        
@@ -50,27 +51,29 @@ class UserStateCondition extends AbstractSingleFieldCondition implements IConten
        protected $userIsNotBanned = 0;
        
        /**
-        * @see \wcf\system\condition\IObjectListCondition::addObjectListCondition()
+        * @inheritDoc
         */
        public function addObjectListCondition(DatabaseObjectList $objectList, array $conditionData) {
-               if (!($objectList instanceof UserList)) return;
+               if (!($objectList instanceof UserList)) {
+                       throw new InvalidArgumentException("Object list is no instance of '".UserList::class."', instance of '".get_class($objectList)."' given.");
+               }
                
                if (isset($conditionData['userIsBanned'])) {
-                       $objectList->getConditionBuilder()->add('user_table.banned = ?', array($conditionData['userIsBanned']));
+                       $objectList->getConditionBuilder()->add('user_table.banned = ?', [$conditionData['userIsBanned']]);
                }
                
                if ($conditionData['userIsEnabled']) {
                        if ($conditionData['userIsEnabled']) {
-                               $objectList->getConditionBuilder()->add('user_table.activationCode = ?', array(0));
+                               $objectList->getConditionBuilder()->add('user_table.activationCode = ?', [0]);
                        }
                        else {
-                               $objectList->getConditionBuilder()->add('user_table.activationCode <> ?', array(0));
+                               $objectList->getConditionBuilder()->add('user_table.activationCode <> ?', [0]);
                        }
                }
        }
        
        /**
-        * @see \wcf\system\condition\IUserCondition::checkUser()
+        * @inheritDoc
         */
        public function checkUser(Condition $condition, User $user) {
                if ($condition->userIsBanned !== null && $user->banned != $condition->userIsBanned) {
@@ -90,10 +93,10 @@ class UserStateCondition extends AbstractSingleFieldCondition implements IConten
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::getData()
+        * @inheritDoc
         */
        public function getData() {
-               $data = array();
+               $data = [];
                
                if ($this->userIsBanned) {
                        $data['userIsBanned'] = 1;
@@ -130,7 +133,7 @@ class UserStateCondition extends AbstractSingleFieldCondition implements IConten
        }
        
        /**
-        * @see \wcf\system\condition\AbstractSingleFieldCondition::getFieldElement()
+        * @inheritDoc
         */
        protected function getFieldElement() {
                $userIsNotBanned = WCF::getLanguage()->get('wcf.user.condition.state.isNotBanned');
@@ -147,7 +150,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::readFormParameters()
+        * @inheritDoc
         */
        public function readFormParameters() {
                if (isset($_POST['userIsBanned'])) $this->userIsBanned = 1;
@@ -157,7 +160,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::reset()
+        * @inheritDoc
         */
        public function reset() {
                $this->userIsBanned = 0;
@@ -167,7 +170,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::setData()
+        * @inheritDoc
         */
        public function setData(Condition $condition) {
                if ($condition->userIsBanned !== null) {
@@ -181,7 +184,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\ICondition::validate()
+        * @inheritDoc
         */
        public function validate() {
                if ($this->userIsBanned && $this->userIsNotBanned) {
@@ -198,7 +201,7 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\IContentCondition::showContent()
+        * @inheritDoc
         */
        public function showContent(Condition $condition) {
                if (!WCF::getUser()->userID) return false;
index f2ed3cf22852535b720ccfff4d72d295d63851d6..16788d03e270c4840d3a0b815427a3be217585b3 100644 (file)
@@ -21,26 +21,26 @@ class UserTimestampPropertyCondition extends AbstractTimestampCondition implemen
        use TObjectUserCondition;
        
        /**
-        * @see \wcf\system\condition\AbstractTimestampCondition::$className
+        * @inheritDoc
         */
        protected $className = User::class;
        
        /**
-        * @see \wcf\system\condition\AbstractTimestampCondition::getLanguageItemPrefix()
+        * @inheritDoc
         */
        protected function getLanguageItemPrefix() {
                return 'wcf.user.condition';
        }
        
        /**
-        * @see \wcf\system\condition\AbstractTimestampCondition::getPropertyName()
+        * @inheritDoc
         */
        protected function getPropertyName() {
                return $this->getDecoratedObject()->propertyname;
        }
        
        /**
-        * @see \wcf\system\condition\IContentCondition::showContent()
+        * @inheritDoc
         */
        public function showContent(Condition $condition) {
                if (!WCF::getUser()->userID) return false;
index 9205e4b9d0b8857227e1949b4cf1c48c446046b1..d17db653c00637d745312251b4880d5ebed456e7 100644 (file)
@@ -4,13 +4,14 @@ use wcf\data\condition\Condition;
 use wcf\data\user\User;
 use wcf\data\user\UserList;
 use wcf\data\DatabaseObjectList;
+use wcf\system\exception\InvalidArgumentException;
 use wcf\system\WCF;
 
 /**
  * Condition implementation for the username of a user.
  * 
  * @author     Matthias Schmidt
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.condition
@@ -20,33 +21,35 @@ class UserUsernameCondition extends AbstractTextCondition implements IContentCon
        use TObjectListUserCondition;
        
        /**
-        * @see \wcf\system\condition\AbstractTextCondition::$fieldName
+        * @inheritDoc
         */
        protected $fieldName = 'username';
        
        /**
-        * @see \wcf\system\condition\AbstractSingleFieldCondition::$label
+        * @inheritDoc
         */
        protected $label = 'wcf.user.username';
        
        /**
-        * @see \wcf\system\condition\IObjectListCondition::addObjectListCondition()
+        * @inheritDoc
         */
        public function addObjectListCondition(DatabaseObjectList $objectList, array $conditionData) {
-               if (!($objectList instanceof UserList)) return;
+               if (!($objectList instanceof UserList)) {
+                       throw new InvalidArgumentException("Object list is no instance of '".UserList::class."', instance of '".get_class($objectList)."' given.");
+               }
                
-               $objectList->getConditionBuilder()->add('user_table.username LIKE ?', array('%'.addcslashes($conditionData['username'], '_%').'%'));
+               $objectList->getConditionBuilder()->add('user_table.username LIKE ?', ['%'.addcslashes($conditionData['username'], '_%').'%']);
        }
        
        /**
-        * @see \wcf\system\condition\IUserCondition::checkUser()
+        * @inheritDoc
         */
        public function checkUser(Condition $condition, User $user) {
                return mb_strpos($user->username, $condition->username) !== false;
        }
        
        /**
-        * @see \wcf\system\condition\IContentCondition::showContent()
+        * @inheritDoc
         */
        public function showContent(Condition $condition) {
                if (!WCF::getUser()->userID) return false;