Skip to content

Commit 6d27964

Browse files
committed
fix deprecated warnings
fix call to MFException constr
1 parent 299c468 commit 6d27964

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

core/designdocument.class.inc.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,13 @@ protected function Init()
7070
$this->preserveWhiteSpace = true; // otherwise the formatOutput option would have no effect
7171
}
7272

73-
public function loadXML(string $source, int $options = 0)
73+
/**
74+
* @param string $source
75+
* @param int $options
76+
*
77+
* @return bool|\DOMDocument
78+
*/
79+
public function loadXML(string $source, int $options = 0): bool|DOMDocument
7480
{
7581
return parent::loadXML($source, $options | LIBXML_BIGLINES);
7682
}

setup/modelfactory.class.inc.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ class MFException extends Exception
7171
*
7272
* @inheritDoc
7373
*
74-
* @param $message
75-
* @param $code: error code
76-
* @param $oNode: dom node
77-
* @param $sXPath: XML xpath: if provided used in exception message. otherwise computed via $oNode
78-
* @param $sExtraInfo: additional information stored in exception
79-
* @param $oParentFallbackNode: fallback dom node (usually parent). in case $oNode XML line is wrong (set to 0), line number computed/displayed in error message comes from $oParentFallbackNode
74+
* @param string $message
75+
* @param int $code: error code
76+
* @param DesignElement $oNode: dom node
77+
* @param string|null $sXPath: XML xpath: if provided used in exception message. otherwise computed via $oNode
78+
* @param string $sExtraInfo: additional information stored in exception
79+
* @param DesignElement|null $oParentFallbackNode: fallback dom node (usually parent). in case $oNode XML line is wrong (set to 0), line number computed/displayed in error message comes from $oParentFallbackNode
8080
*/
81-
public function __construct($message = null, $code = 0, $oNode, $sXPath = null, $sExtraInfo = '', $oParentFallbackNode = null)
81+
public function __construct(string $message, int $code, DesignElement $oNode, ?string $sXPath = null, string $sExtraInfo = '', ?DesignElement $oParentFallbackNode = null)
8282
{
8383
$iSourceLineNumber = ModelFactory::GetXMLLineNumber($oNode);
8484
if ($iSourceLineNumber == 0 && ! is_null($oParentFallbackNode)) {
@@ -2125,13 +2125,13 @@ public function RedefineChildNode(MFElement $oNode, $sSearchId = null, $oParentF
21252125
$oExisting = $this->_FindChildNode($oNode, $sSearchId);
21262126
if (!$oExisting) {
21272127
$sPath = MFDocument::GetItopNodePath($this)."/".$oNode->tagName.(empty($sSearchId) ? '' : "[$sSearchId]");
2128-
throw new MFException('could not be modified (not found)', MFException::COULD_NOT_BE_MODIFIED_NOT_FOUND, $oNode, $sPath, $oParentFallbackNode);
2128+
throw new MFException('could not be modified (not found)', MFException::COULD_NOT_BE_MODIFIED_NOT_FOUND, $oNode, $sPath, '', $oParentFallbackNode);
21292129
}
21302130
$sPrevFlag = $oExisting->GetAlteration();
21312131
$sOldId = $oExisting->getAttribute('_old_id');
21322132
if ($oExisting->IsRemoved()) {
21332133
$sPath = MFDocument::GetItopNodePath($this)."/".$oNode->tagName.(empty($sSearchId) ? '' : "[$sSearchId]");
2134-
throw new MFException('could not be modified (marked as deleted)', MFException::COULD_NOT_BE_MODIFIED_ALREADY_DELETED, $oNode, $sPath, $oParentFallbackNode);
2134+
throw new MFException('could not be modified (marked as deleted)', MFException::COULD_NOT_BE_MODIFIED_ALREADY_DELETED, $oNode, $sPath, '', $oParentFallbackNode);
21352135
}
21362136
$oExisting->ReplaceWithSingleNode($oNode);
21372137
if (!$this->IsInDefinition()) {

0 commit comments

Comments
 (0)