Fix return type of Category::getObjectType()
authorMatthias Schmidt <gravatronics@live.com>
Mon, 16 May 2016 10:14:32 +0000 (12:14 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 16 May 2016 10:14:32 +0000 (12:14 +0200)
wcfsetup/install/files/lib/data/category/Category.class.php

index b8bad41e52cb9c39125dce721381c3b9064af5f5..ed5f0dea906998e20c6ca55949d5663e47fcd960 100644 (file)
@@ -1,10 +1,12 @@
 <?php
 namespace wcf\data\category;
+use wcf\data\object\type\ObjectType;
 use wcf\data\user\User;
 use wcf\data\IPermissionObject;
 use wcf\data\ProcessibleDatabaseObject;
 use wcf\system\category\CategoryHandler;
 use wcf\system\category\CategoryPermissionHandler;
+use wcf\system\category\ICategoryType;
 use wcf\system\exception\PermissionDeniedException;
 use wcf\system\request\IRouteController;
 use wcf\system\WCF;
@@ -13,12 +15,12 @@ use wcf\system\WCF;
  * Represents a category.
  * 
  * @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 data.category
  * @category   Community Framework
- *
+ * 
  * @property-read      integer         $categoryID
  * @property-read      integer         $objectTypeID
  * @property-read      integer         $parentCategoryID
@@ -44,7 +46,7 @@ class Category extends ProcessibleDatabaseObject implements IPermissionObject, I
        
        /**
         * parent category of this category
-        * @var \wcf\data\category\Category
+        * @var Category
         */
        protected $parentCategory = null;
        
@@ -60,7 +62,7 @@ class Category extends ProcessibleDatabaseObject implements IPermissionObject, I
         * belong to
         * @var array
         */
-       protected $userPermissions = array();
+       protected $userPermissions = [];
        
        /**
         * fallback return value used in Category::getPermission()
@@ -69,22 +71,22 @@ class Category extends ProcessibleDatabaseObject implements IPermissionObject, I
        protected $defaultPermission = false;
        
        /**
-        * @see \wcf\data\DatabaseObject::$databaseTableIndexName
+        * @inheritDoc
         */
        protected static $databaseTableIndexName = 'categoryID';
        
        /**
-        * @see \wcf\data\DatabaseObject::$databaseTableName
+        * @inheritDoc
         */
        protected static $databaseTableName = 'category';
        
        /**
-        * @see \wcf\data\ProcessibleDatabaseObject::$processorInterface
+        * @inheritDoc
         */
-       protected static $processorInterface = 'wcf\system\category\ICategoryType';
+       protected static $processorInterface = ICategoryType::class;
        
        /**
-        * @see \wcf\data\IStorableObject::__get()
+        * @inheritDoc
         */
        public function __get($name) {
                // forward 'className' property requests to object type
@@ -105,7 +107,7 @@ class Category extends ProcessibleDatabaseObject implements IPermissionObject, I
        }
        
        /**
-        * @see \wcf\data\IPermissionObject::checkPermissions()
+        * @inheritDoc
         */
        public function checkPermissions(array $permissions) {
                foreach ($permissions as $permission) {
@@ -118,7 +120,7 @@ class Category extends ProcessibleDatabaseObject implements IPermissionObject, I
        /**
         * Returns the category object type of the category.
         * 
-        * @return      \wcf\data\category\Category
+        * @return      ObjectType
         */
        public function getObjectType() {
                return CategoryHandler::getInstance()->getObjectType($this->objectTypeID);
@@ -140,7 +142,7 @@ class Category extends ProcessibleDatabaseObject implements IPermissionObject, I
        /**
         * Returns the parent category of this category.
         * 
-        * @return      \wcf\data\category\Category
+        * @return      Category
         */
        public function getParentCategory() {
                if ($this->parentCategoryID && $this->parentCategory === null) {
@@ -157,7 +159,7 @@ class Category extends ProcessibleDatabaseObject implements IPermissionObject, I
         */
        public function getParentCategories() {
                if ($this->parentCategories === null) {
-                       $this->parentCategories = array();
+                       $this->parentCategories = [];
                        $parentCaregory = $this;
                        while ($parentCaregory = $parentCaregory->getParentCategory()) {
                                $this->parentCategories[] = $parentCaregory;
@@ -172,7 +174,7 @@ class Category extends ProcessibleDatabaseObject implements IPermissionObject, I
        /**
         * Returns true if given category is a parent category of this category.
         * 
-        * @param       \wcf\data\category\Category     $category
+        * @param       Category        $category
         * @return      boolean
         */
        public function isParentCategory(Category $category) {
@@ -180,7 +182,7 @@ class Category extends ProcessibleDatabaseObject implements IPermissionObject, I
        }
        
        /**
-        * @see \wcf\data\IPermissionObject::getPermission()
+        * @inheritDoc
         */
        public function getPermission($permission, User $user = null) {
                if ($user === null) {
@@ -211,7 +213,7 @@ class Category extends ProcessibleDatabaseObject implements IPermissionObject, I
        }
        
        /**
-        * @see \wcf\data\ITitledObject::getTitle()
+        * @inheritDoc
         */
        public function getTitle() {
                return WCF::getLanguage()->get($this->title);
@@ -228,20 +230,20 @@ class Category extends ProcessibleDatabaseObject implements IPermissionObject, I
        }
        
        /**
-        * @see \wcf\data\DatabaseObject::handleData()
+        * @inheritDoc
         */
        protected function handleData($data) {
                // handle additional data
                $data['additionalData'] = @unserialize($data['additionalData']);
                if (!is_array($data['additionalData'])) {
-                       $data['additionalData'] = array();
+                       $data['additionalData'] = [];
                }
                
                parent::handleData($data);
        }
        
        /**
-        * @see \wcf\data\ITitledObject::getTitle()
+        * @inheritDoc
         */
        public function __toString() {
                return $this->getTitle();