/**
* @inheritDoc
*/
- public function addEntry(string $id, array $entry) {
+ public function addEntry($id, array $entry) {
if ($this->keys === null) {
throw new \BadMethodCallException("No keys have been set.");
}
*
* Before adding entries, the keys must be set.
*
- * @param string $identifier unique entry ident
+ * @param string $id unique entry identifier
* @param array $entry entry data
* @throws \BadMethodCallException if no keys have been set
*/
- public function addEntry(string $id, array $entry);
+ public function addEntry($id, array $entry);
/**
* Returns all entries in the list.
* @param string $identifier
* @return string new identifier
*/
- public function editEntry(IFormDocument $form, string $identifier): string;
+ public function editEntry(IFormDocument $form, $identifier);
/**
* Returns additional template code for the form to add and edit entries.
*
* @return string
*/
- public function getAdditionalTemplateCode(): string;
+ public function getAdditionalTemplateCode();
/**
* Returns a list of all pip entries of this pip.
*
* @return IDevtoolsPipEntryList
*/
- public function getEntryList(): IDevtoolsPipEntryList;
+ public function getEntryList();
/**
* Informs the pip of the identifier of the edited entry if the form to
*
* @throws \InvalidArgumentException if no such entry exists
*/
- public function setEditedEntryIdentifier(string $identifier);
+ public function setEditedEntryIdentifier($identifier);
/**
* Adds the data of the pip entry with the given identifier into the
* @param IFormDocument $document
* @return bool
*/
- public function setEntryData(string $identifier, IFormDocument $document): bool;
+ public function setEntryData($identifier, IFormDocument $document);
/**
* Returns the list of available entry types. If only one entry type is
*
* @return string[]
*/
- public function getEntryTypes(): array;
+ public function getEntryTypes();
/**
* Sets the type of the currently handled pip entries.
*
* @throws \InvalidArgumentException if the given entry type is invalid (see `getEntryTypes()` method)
*/
- public function setEntryType(string $entryType);
+ public function setEntryType($entryType);
}
* @param string $identifier
* @return string new identifier
*/
- public function editEntry(IFormDocument $form, string $identifier) {
+ public function editEntry(IFormDocument $form, $identifier) {
$xml = $this->getProjectXml();
$document = $xml->getDocument();
* @param string $value
* @return string
*/
- protected function getAutoCdataValue(string $value) {
+ protected function getAutoCdataValue($value) {
if (strpos('<', $value) !== false || strpos('>', $value) !== false || strpos('&', $value) !== false) {
$value = '<![CDATA[' . StringUtil::escapeCDATA($value) . ']]>';
}
* @param string $identifier
* @return \DOMElement|null
*/
- protected function getElementByIdentifier(XML $xml, string $identifier) {
+ protected function getElementByIdentifier(XML $xml, $identifier) {
foreach ($this->getImportElements($xml->xpath()) as $element) {
if ($this->getElementIdentifier($element) === $identifier) {
return $element;
* @param bool $saveData is `true` if data is intended to be saved and otherwise `false`
* @return array
*/
- abstract protected function getElementData(\DOMElement $element, bool $saveData = false);
+ abstract protected function getElementData(\DOMElement $element, $saveData = false);
/**
* Returns the identifier of the given `import` element.
*
* @throws \InvalidArgumentException if no such entry exists
*/
- public function setEditedEntryIdentifier(string $identifier) {
+ public function setEditedEntryIdentifier($identifier) {
$this->editedEntry = $this->getElementByIdentifier($this->getProjectXml(), $identifier);
if ($this->editedEntry === null) {
* @param IFormDocument $document
* @return bool
*/
- public function setEntryData(string $identifier, IFormDocument $document) {
+ public function setEntryData($identifier, IFormDocument $document) {
$xml = $this->getProjectXml();
$element = $this->getElementByIdentifier($xml, $identifier);
*
* @throws \InvalidArgumentException if the given entry type is invalid (see `getEntryTypes()` method)
*/
- public function setEntryType(string $entryType) {
+ public function setEntryType($entryType) {
if (!in_array($entryType, $this->getEntryTypes())) {
throw new \InvalidArgumentException("Unknown entry type '{$entryType}'.");
}
* @inheritDoc
* @since 3.2
*/
- protected function getElementData(\DOMElement $element, bool $saveData = false) {
+ protected function getElementData(\DOMElement $element, $saveData = false) {
$data = [
'name' => $element->getAttribute('name'),
'packageID' => $this->installation->getPackage()->packageID,
// icons are only available for menu items on the first or fourth level
// thus the parent menu item must be on zeroth level (no parent menu item)
// or on the third level
- $iconParentMenuItems = array_keys(array_filter($menuItemLevels, function(int $value) {
+ $iconParentMenuItems = array_keys(array_filter($menuItemLevels, function($value) {
return $value === 0 || $value == 3;
}));
// menu items on the first and second level do not support links,
// thus the parent menu item must be at least on the second level
// for the menu item to support links
- $menuItemsSupportingLinks = array_keys(array_filter($menuItemLevels, function(int $menuItemLevel) {
+ $menuItemsSupportingLinks = array_keys(array_filter($menuItemLevels, function($menuItemLevel) {
return $menuItemLevel >= 2;
}));
* @inheritDoc
* @since 3.2
*/
- protected function getElementData(\DOMElement $element, bool $saveData = false) {
+ protected function getElementData(\DOMElement $element, $saveData = false) {
$data = parent::getElementData($element);
$icon = $element->getElementsByTagName('icon')->item(0);
* @inheritDoc
* @since 3.2
*/
- protected function getElementData(\DOMElement $element, bool $saveData = false) {
+ protected function getElementData(\DOMElement $element, $saveData = false) {
$data = [
'className' => $element->getElementsByTagName('classname')->item(0)->nodeValue,
'packageID' => $this->installation->getPackage()->packageID,
'value' => ''
]];
- $buildOptions = function(string $parent = '', int $depth = 0) use ($menuStructure, &$buildOptions) {
+ $buildOptions = function($parent = '', $depth = 0) use ($menuStructure, &$buildOptions) {
// only consider menu items until the third level (thus only parent
// menu items until the second level) as potential parent menu items
if ($depth > 2) {
* @inheritDoc
* @since 3.2
*/
- protected function getElementData(\DOMElement $element, bool $saveData = false) {
+ protected function getElementData(\DOMElement $element, $saveData = false) {
$data = [
'menuItem' => $element->getAttribute('name'),
'packageID' => $this->installation->getPackage()->packageID
// build array containing the ACP menu items saved in the database
// in the order as they would be displayed in the ACP
- $buildPositions = function(string $parent = '') use ($menuItemStructure, &$buildPositions) {
+ $buildPositions = function($parent = '') use ($menuItemStructure, &$buildPositions) {
$positions = [];
foreach ($menuItemStructure[$parent] as $menuItem) {
// only consider menu items of the current package for positions
* @inheritDoc
* @since 3.2
*/
- protected function getElementData(\DOMElement $element, bool $saveData = false) {
+ protected function getElementData(\DOMElement $element, $saveData = false) {
$data = [
'actionClassName' => $element->getElementsByTagName('actionclassname')->item(0)->nodeValue,
'actionName' => $element->getAttribute('name'),
* @inheritDoc
* @since 3.2
*/
- protected function getElementData(\DOMElement $element, bool $saveData = false) {
+ protected function getElementData(\DOMElement $element, $saveData = false) {
return [
'objectName' => $element->getElementsByTagName('objectname')->item(0)->nodeValue,
'packageID' => $this->installation->getPackage()->packageID
* @inheritDoc
* @since 3.2
*/
- protected function getElementData(\DOMElement $element, bool $saveData = false) {
+ protected function getElementData(\DOMElement $element, $saveData = false) {
$data = [
'className' => $element->getElementsByTagName('classname')->item(0)->nodeValue,
'cronjobName' => $element->getAttribute('name'),
* @inheritDoc
* @since 3.2
*/
- protected function getElementData(\DOMElement $element, bool $saveData = false) {
+ protected function getElementData(\DOMElement $element, $saveData = false) {
$data = [
'eventClassName' => $element->getElementsByTagName('eventclassname')->item(0)->nodeValue,
'eventName' => StringUtil::normalizeCsv($element->getElementsByTagName('eventname')->item(0)->nodeValue),
* @inheritDoc
* @since 3.2
*/
- protected function getElementData(\DOMElement $element, bool $saveData = false) {
+ protected function getElementData(\DOMElement $element, $saveData = false) {
$data = [
'name' => $element->getAttribute('name'),
'packageID' => $this->installation->getPackage()->packageID,
* @param string $identifier
* @return null|int
*/
- protected function getMenuID(string $identifier) {
+ protected function getMenuID($identifier) {
$sql = "SELECT menuID
FROM wcf" . WCF_N . "_menu
WHERE identifier = ?";
* @param string $identifier
* @return null|int
*/
- protected function getPageID(string $identifier) {
+ protected function getPageID($identifier) {
$sql = "SELECT pageID
FROM wcf" . WCF_N . "_page
WHERE identifier = ?";
* @inheritDoc
* @since 3.2
*/
- protected function getElementData(\DOMElement $element, bool $saveData = false) {
+ protected function getElementData(\DOMElement $element, $saveData = false) {
$data = [
'identifier' => $element->getAttribute('identifier'),
'packageID' => $this->installation->getPackageID(),
* @inheritDoc
* @since 3.2
*/
- protected function getElementData(\DOMElement $element, bool $saveData = false) {
+ protected function getElementData(\DOMElement $element, $saveData = false) {
$data = [
'identifier' => $element->getAttribute('identifier'),
'packageID' => $this->installation->getPackageID(),
* @inheritDoc
* @since 3.2
*/
- protected function getElementData(\DOMElement $element, bool $saveData = false) {
+ protected function getElementData(\DOMElement $element, $saveData = false) {
$data = [
'definitionName' => $element->getElementsByTagName('name')->item(0)->nodeValue,
'packageID' => $this->installation->getPackage()->packageID
* @inheritDoc
* @since 3.2
*/
- protected function getElementData(\DOMElement $element, bool $saveData = false) {
+ protected function getElementData(\DOMElement $element, $saveData = false) {
$data = [
'definitionID' => $this->getDefinitionID($element->getElementsByTagName('definitionname')->item(0)->nodeValue),
'objectType' => $element->getElementsByTagName('name')->item(0)->nodeValue,
* @return FormContainer
* @since 3.2
*/
- public function getObjectTypeDefinitionDataContainer(IFormDocument $form, string $definitionName) {
+ public function getObjectTypeDefinitionDataContainer(IFormDocument $form, $definitionName) {
/** @var SingleSelectionFormField $definitionNameField */
$definitionIDField = $form->getNodeById('definitionID');
* @param IFormDocument $form
* @param string $objectTypeDefinition
*/
- public function addBulkProcessingActionFields(IFormDocument $form, string $objectTypeDefinition) {
+ public function addBulkProcessingActionFields(IFormDocument $form, $objectTypeDefinition) {
$definitionPieces = explode('.', $objectTypeDefinition);
$definitionIdString = implode('', array_map('ucfirst', $definitionPieces));
* @param bool $addConditionGroup
* @since 3.2
*/
- public function addConditionFields(IFormContainer $dataContainer, bool $addConditionObject = true, bool $addConditionGroup = true) {
+ public function addConditionFields(IFormContainer $dataContainer, $addConditionObject = true, $addConditionGroup = true) {
$prefix = preg_replace('~Fields$~', '', $dataContainer->getId());
if ($addConditionObject) {
* @param string $databaseTableName name of the database table that stores the conditioned objects
* @return TextFormField
*/
- public function getIntegerConditionPropertyNameField(TextFormField $classNameField, string $conditionClass, string $id, string $languageItemPrefix, string $databaseTableName) {
+ public function getIntegerConditionPropertyNameField(TextFormField $classNameField, $conditionClass, $id, $languageItemPrefix, $databaseTableName) {
return TextFormField::create($id)
->objectProperty('propertyname')
->label($languageItemPrefix . '.propertyName')
* @param int $minimumSegmentCount minimum number of dot-separated segments
* @return FormFieldValidator
*/
- public static function getObjectTypeAlikeValueValidator(string $languageItemPrefix, int $minimumSegmentCount = 4) {
+ public static function getObjectTypeAlikeValueValidator($languageItemPrefix, $minimumSegmentCount = 4) {
return new FormFieldValidator('format', function(TextFormField $formField) use ($languageItemPrefix, $minimumSegmentCount) {
if ($formField->getValue()) {
$segments = explode('.', $formField->getValue());
* @inheritDoc
* @since 3.2
*/
- protected function getElementData(\DOMElement $element, bool $saveData = false) {
+ protected function getElementData(\DOMElement $element, $saveData = false) {
return [
'className' => $element->nodeValue,
'pluginName' => $element->getAttribute('name'),
* @inheritDoc
* @since 3.2
*/
- protected function getElementData(\DOMElement $element, bool $saveData = false) {
+ protected function getElementData(\DOMElement $element, $saveData = false) {
$data = [
'identifier' => $element->getAttribute('identifier'),
'originIsSystem' => 1,
}
}
- $readData = function(int $languageID, \DOMElement $content) use (&$data) {
+ $readData = function($languageID, \DOMElement $content) use (&$data) {
foreach (['title', 'content', 'customURL', 'metaDescription', 'metaKeywords'] as $contentElementName) {
$contentElement = $content->getElementsByTagName($contentElementName)->item(0);
if ($contentElement) {
* @inheritDoc
* @since 3.2
*/
- protected function getElementData(\DOMElement $element, bool $saveData = false) {
+ protected function getElementData(\DOMElement $element, $saveData = false) {
return [
'environment' => $element->getElementsByTagName('environment')->item(0)->nodeValue,
'eventName' => $element->getElementsByTagName('eventname')->item(0)->nodeValue,
// menu items on the first and second level do not support links,
// thus the parent menu item must be at least on the second level
// for the menu item to support links
- $menuItemsSupportingLinks = array_keys(array_filter($menuItemLevels, function(int $menuItemLevel) {
+ $menuItemsSupportingLinks = array_keys(array_filter($menuItemLevels, function($menuItemLevel) {
return $menuItemLevel >= 2;
}));
* @inheritDoc
* @since 3.2
*/
- protected function getElementData(\DOMElement $element, bool $saveData = false) {
+ protected function getElementData(\DOMElement $element, $saveData = false) {
$data = parent::getElementData($element);
$className = $element->getElementsByTagName('classname')->item(0);
* @inheritDoc
* @since 3.2
*/
- protected function getElementData(\DOMElement $element, bool $saveData = false) {
+ protected function getElementData(\DOMElement $element, $saveData = false) {
$data = [
'className' => $element->getElementsByTagName('classname')->item(0)->nodeValue,
'objectTypeID' => $this->getObjectTypeID($element->getElementsByTagName('objecttype')->item(0)->nodeValue),
* @inheritDoc
* @since 3.2
*/
- protected function getElementData(\DOMElement $element, bool $saveData = false) {
+ protected function getElementData(\DOMElement $element, $saveData = false) {
$data = [
'className' => $element->getElementsByTagName('classname')->item(0)->nodeValue,
'menuItem' => $element->getAttribute('name'),