/**
* @inheritDoc
- */
+ */
public $tagName = 'option';
/**
*/
protected function importCategories(\DOMXPath $xpath) {
$elements = $xpath->query('/ns:data/ns:import/ns:categories/ns:category');
+
+ /** @var \DOMElement $element */
foreach ($elements as $element) {
$data = ['categoryName' => $element->getAttribute('name')];
*/
protected function importOptions(\DOMXPath $xpath) {
$elements = $xpath->query('/ns:data/ns:import/ns:options/ns:option');
+
+ /** @var \DOMElement $element */
foreach ($elements as $element) {
$data = [];
$children = $xpath->query('child::*', $element);
}
foreach ($templates as $application => $templateNames) {
+ /** @noinspection PhpUndefinedMethodInspection */
$this->installation->deleteFiles(Application::getDirectory($application), $templateNames, false, $this->installation->getPackage()->isApplication);
// delete log entries
// delete options
$elements = $xpath->query('/ns:data/ns:delete/ns:option');
$options = [];
+
+ /** @var \DOMElement $element */
foreach ($elements as $element) {
$options[] = $element->getAttribute('name');
}
// delete categories
$elements = $xpath->query('/ns:data/ns:delete/ns:optioncategory');
$categories = [];
+
+ /** @var \DOMElement $element */
foreach ($elements as $element) {
$categories[] = $element->getAttribute('name');
}
*/
protected function importCategories(\DOMXPath $xpath) {
$elements = $xpath->query('/ns:data/ns:import/ns:categories/ns:category');
+
+ /** @var \DOMElement $element */
foreach ($elements as $element) {
$data = [];
*/
protected function importOptions(\DOMXPath $xpath) {
$elements = $xpath->query('/ns:data/ns:import/ns:options/ns:option');
+
+ /** @var \DOMElement $element */
foreach ($elements as $element) {
$data = [];
$children = $xpath->query('child::*', $element);
<?php
namespace wcf\system\package\plugin;
use wcf\data\bbcode\attribute\BBCodeAttributeEditor;
+use wcf\data\bbcode\BBCode;
use wcf\data\bbcode\BBCodeEditor;
use wcf\data\package\PackageCache;
use wcf\system\database\util\PreparedStatementConditionBuilder;
$attributes = $data['attributes'];
unset($data['attributes']);
- // import or update action
- $object = parent::import($row, $data);
+ /** @var BBCode $bbcode */
+ $bbcode = parent::import($row, $data);
// store attributes for later import
- $this->attributes[$object->bbcodeID] = $attributes;
+ $this->attributes[$bbcode->bbcodeID] = $attributes;
+
+ return $bbcode;
}
/**
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
$boxes = [];
+
+ /** @var Box $box */
while ($box = $statement->fetchObject(Box::class)) {
$boxes[$box->identifier] = $box;
}
<?php
namespace wcf\system\package\plugin;
+use wcf\data\clipboard\action\ClipboardAction;
use wcf\data\clipboard\action\ClipboardActionEditor;
use wcf\system\WCF;
$pages = $data['pages'];
unset($data['pages']);
- // import or update action
- $object = parent::import($row, $data);
+ /** @var ClipboardAction $action */
+ $action = parent::import($row, $data);
// store pages for later import
- $this->pages[$object->actionID] = $pages;
+ $this->pages[$action->actionID] = $pages;
+
+ return $action;
}
/**
unset($data['cronjobName']);
}
+ /** @var Cronjob $cronjob */
$cronjob = parent::import($row, $data);
// update cronjob name
unset($data['listenerName']);
}
+ /** @var EventListener $eventListener */
$eventListener = parent::import($row, $data);
// update event listener name
}
foreach ($files as $application => $filenames) {
+ /** @noinspection PhpUndefinedMethodInspection */
$this->installation->deleteFiles(Application::getDirectory($application), $filenames);
// delete log entries
WHERE identifier = ?";
$statement = WCF::getDB()->prepareStatement($sql, 1);
$statement->execute([$data['elements']['parent']]);
+
+ /** @var MenuItem|null $parent */
$parent = $statement->fetchObject(MenuItem::class);
if ($parent === null) {
throw new SystemException("Unable to find parent menu item '" . $data['elements']['parent'] . "' for menu item '" . $data['attributes']['identifier'] . "'");
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
$boxes = [];
+
+ /** @var Box $box */
while ($box = $statement->fetchObject(Box::class)) {
$boxes[$box->identifier] = $box;
}
<?php
namespace wcf\system\package\plugin;
use wcf\data\package\PackageCache;
+use wcf\data\page\Page;
use wcf\data\page\PageEditor;
use wcf\system\exception\SystemException;
use wcf\system\language\LanguageFactory;
$content = $data['content'];
unset($data['content']);
+ /** @var Page $page */
if (!empty($row)) {
// allow only updating of controller, everything else would overwrite user modifications
if (!empty($data['controller'])) {
- $object = parent::import($row, ['controller' => $data['controller']]);
+ $page = parent::import($row, ['controller' => $data['controller']]);
}
else {
$baseClass = call_user_func([$this->className, 'getBaseClass']);
- $object = new $baseClass(null, $row);
+ $page = new $baseClass(null, $row);
}
}
else {
// import
- $object = parent::import($row, $data);
+ $page = parent::import($row, $data);
}
// store content for later import
- $this->content[$object->pageID] = $content;
+ $this->content[$page->pageID] = $content;
- return $object;
+ return $page;
}
/**
}
foreach ($templates as $application => $templateNames) {
+ /** @noinspection PhpUndefinedMethodInspection */
$this->installation->deleteFiles(Application::getDirectory($application), $templateNames, false, $this->installation->getPackage()->isApplication);
// delete log entries
<?php
namespace wcf\system\package\plugin;
+use wcf\data\user\notification\event\UserNotificationEvent;
use wcf\data\user\notification\event\UserNotificationEventEditor;
use wcf\system\exception\SystemException;
use wcf\system\WCF;
* @inheritDoc
*/
protected function import(array $row, array $data) {
- $result = parent::import($row, $data);
+ /** @var UserNotificationEvent $event */
+ $event = parent::import($row, $data);
if (empty($row) && $data['preset']) {
- $this->presetEventIDs[$result->eventID] = $data['presetMailNotificationType'];
+ $this->presetEventIDs[$event->eventID] = $data['presetMailNotificationType'];
}
- return $result;
+ return $event;
}
/**