Apply PSR-12 code style (#3886)
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / system / importer / ArticleCommentImporter.class.php
index e3ed59d9e05155acf78050d4c2a5d45a5e128acf..4e740c4e41c573d28cba23d5c37758075fb13965 100644 (file)
@@ -1,40 +1,49 @@
 <?php
+
 namespace wcf\system\importer;
+
 use wcf\data\article\Article;
 use wcf\data\object\type\ObjectTypeCache;
 
 /**
  * Imports article comments.
  *
- * @author     Marcel Werk
- * @copyright  2001-2019 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    WoltLabSuite\Core\System\Importer
+ * @author  Marcel Werk
+ * @copyright   2001-2019 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core\System\Importer
  */
-class ArticleCommentImporter extends AbstractCommentImporter {
-       /**
-        * @inheritDoc
-        */
-       protected $objectTypeName = 'com.woltlab.wcf.article.comment';
-       
-       /**
-        * Creates a new ArticleCommentImporter object.
-        */
-       public function __construct() {
-               $objectType = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.comment.commentableContent', 'com.woltlab.wcf.articleComment');
-               $this->objectTypeID = $objectType->objectTypeID;
-       }
-       
-       /**
-        * @inheritDoc
-        */
-       public function import($oldID, array $data, array $additionalData = []) {
-               $articleID = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.article', $data['objectID'] ?? $additionalData['articleID']);
-               if (!$articleID) return 0;
-               $article = new Article($articleID);
-               $contents = $article->getArticleContents();
-               $data['objectID'] = reset($contents)->articleContentID;
-               
-               return parent::import($oldID, $data);
-       }
+class ArticleCommentImporter extends AbstractCommentImporter
+{
+    /**
+     * @inheritDoc
+     */
+    protected $objectTypeName = 'com.woltlab.wcf.article.comment';
+
+    /**
+     * Creates a new ArticleCommentImporter object.
+     */
+    public function __construct()
+    {
+        $objectType = ObjectTypeCache::getInstance()
+            ->getObjectTypeByName('com.woltlab.wcf.comment.commentableContent', 'com.woltlab.wcf.articleComment');
+        $this->objectTypeID = $objectType->objectTypeID;
+    }
+
+    /**
+     * @inheritDoc
+     */
+    public function import($oldID, array $data, array $additionalData = [])
+    {
+        $articleID = ImportHandler::getInstance()
+            ->getNewID('com.woltlab.wcf.article', $data['objectID'] ?? $additionalData['articleID']);
+        if (!$articleID) {
+            return 0;
+        }
+        $article = new Article($articleID);
+        $contents = $article->getArticleContents();
+        $data['objectID'] = \reset($contents)->articleContentID;
+
+        return parent::import($oldID, $data);
+    }
 }