diff --git a/core/designdocument.class.inc.php b/core/designdocument.class.inc.php index ae873adba..29c1fe743 100644 --- a/core/designdocument.class.inc.php +++ b/core/designdocument.class.inc.php @@ -77,6 +77,7 @@ class DesignDocument extends DOMDocument * * @return int */ + // 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) { diff --git a/core/oql/oql-parser.php b/core/oql/oql-parser.php index 0c2c80b74..5bd6d1577 100644 --- a/core/oql/oql-parser.php +++ b/core/oql/oql-parser.php @@ -38,7 +38,9 @@ class OQLParser_yyToken implements ArrayAccess return isset($this->metadata[$offset]); } - function offsetGet($offset): mixed + // Return type mixed 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] + function offsetGet($offset) { return $this->metadata[$offset]; } diff --git a/core/ormlinkset.class.inc.php b/core/ormlinkset.class.inc.php index 937d65ba0..47abb66fe 100644 --- a/core/ormlinkset.class.inc.php +++ b/core/ormlinkset.class.inc.php @@ -374,7 +374,9 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator * @throws \MySQLException * @throws \MySQLHasGoneAwayException */ - public function current(): mixed + // Return type mixed 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 current() { $this->LoadOriginalIds(); @@ -439,7 +441,9 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator * @link http://php.net/manual/en/iterator.key.php * @return mixed scalar on success, or null on failure. */ - public function key(): mixed + // Return type mixed 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 key() { return $this->iCursor; } diff --git a/core/simplegraph.class.inc.php b/core/simplegraph.class.inc.php index 1c5304d1a..0e0f5f249 100644 --- a/core/simplegraph.class.inc.php +++ b/core/simplegraph.class.inc.php @@ -760,12 +760,16 @@ class RelationTypeIterator implements Iterator $this->iCurrentIdx++; } - public function current(): mixed + // Return type mixed 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 current() { return $this->aList[$this->iCurrentIdx]; } - public function key(): mixed + // Return type mixed 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 key() { return $this->iCurrentIdx; } diff --git a/setup/modelfactory.class.inc.php b/setup/modelfactory.class.inc.php index 347a2e040..0b03e8028 100644 --- a/setup/modelfactory.class.inc.php +++ b/setup/modelfactory.class.inc.php @@ -2538,6 +2538,7 @@ class MFDocument extends \Combodo\iTop\DesignDocument * @return string * @throws \Exception */ + // 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 saveXML(DOMNode $node = null, $options = 0) {