Code cleanup
authorAlexander Ebert <ebert@woltlab.com>
Sat, 24 Jun 2017 10:52:39 +0000 (12:52 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 24 Jun 2017 10:52:39 +0000 (12:52 +0200)
See #2286

constants.php
wcfsetup/install/files/lib/system/worker/SitemapRebuildWorker.class.php

index 6cd03be08909a914a6bb468322ad186ebaf41231..fc5737c7e50832bb832d6c6eb035e1f503f7877d 100644 (file)
@@ -225,3 +225,4 @@ define('ENABLE_POLLING', 1);
 define('ENABLE_DESKTOP_NOTIFICATIONS', 1);
 define('FB_SHARE_APP_ID', '');
 define('MODULE_CONTACT_FORM', 0);
+define('SITEMAP_INDEX_TIME_FRAME', 365);
index 6d0dd98dc768c1726d5bdf53f890fdb9428b1765..c0c60c1327d337f4a7b00bfc4418a428f88cf865 100755 (executable)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\system\worker;
+use wcf\data\object\type\ObjectType;
 use wcf\data\object\type\ObjectTypeCache;
 use wcf\data\user\User;
 use wcf\data\DatabaseObjectList;
@@ -34,13 +35,13 @@ class SitemapRebuildWorker extends AbstractWorker {
        
        /**
         * All object types for the site maps.
-        * @var array<ObjectType>
+        * @var ObjectType[]
         */
-       public $sitemapObjects = null;
+       public $sitemapObjects = [];
        
        /**
         * The current worker data.
-        * @var array<mixed>
+        * @var mixed[]
         */
        public $workerData = [];
        
@@ -48,13 +49,13 @@ class SitemapRebuildWorker extends AbstractWorker {
         * The current temporary file as File object.
         * @var File
         */
-       public $file = null;
+       public $file;
        
        /**
         * The user profile of the actual user.
         * @var User
         */
-       private $actualUser = null
+       private $actualUser; 
        
        /**
         * @inheritDoc
@@ -120,6 +121,7 @@ class SitemapRebuildWorker extends AbstractWorker {
                        $sitemapObject = $this->sitemapObjects[$this->workerData['sitemap']]->getProcessor();
                        $sitemapLoopCount = $this->workerData['sitemapLoopCount'];
                        
+                       /** @var DatabaseObjectList $objectList */
                        $objectList = $sitemapObject->getObjectList();
                        
                        if (SITEMAP_INDEX_TIME_FRAME > 0 && $sitemapObject->getLastModifiedColumn() !== null) {