Merge remote-tracking branch 'origin/develop' into feature/4517-from-dev

# Conflicts:
#	CONTRIBUTING.md
#	composer.lock
#	core/designdocument.class.inc.php
#	lib/composer/installed.json
#	lib/composer/installed.php
This commit is contained in:
Molkobain
2022-07-28 10:30:25 +02:00
246 changed files with 19028 additions and 20326 deletions

View File

@@ -26,8 +26,10 @@
namespace Combodo\iTop;
use \DOMDocument;
use \DOMFormatException;
use DOMDocument;
use DOMFormatException;
use IssueLog;
use LogAPI;
/**
* Class \Combodo\iTop\DesignDocument
@@ -64,9 +66,13 @@ class DesignDocument extends DOMDocument
* @param $filename
* @param int $options
*/
public function load($filename, $options = 0)
public function load($filename, $options = null)
{
parent::load($filename, LIBXML_NOBLANKS);
libxml_clear_errors();
if (parent::load($filename, LIBXML_NOBLANKS) === false) {
$aErrors = libxml_get_errors();
IssueLog::Error("Error loading $filename", LogAPI::CHANNEL_DEFAULT, $aErrors);
}
}
/**
@@ -79,10 +85,10 @@ class DesignDocument extends DOMDocument
*/
// Return type union is not supported by PHP 7.4, we can remove the following PHP attribute and add the return type once iTop min PHP version is PHP 8.0+
#[\ReturnTypeWillChange]
public function save($filename, $options = 0)
public function save($filename, $options = null)
{
$this->documentElement->setAttribute('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance");
return parent::save($filename, LIBXML_NOBLANKS);
return parent::save($filename);
}
/**