mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°4517 - PHP 8.1: Replace mixed return types with #[\ReturnTypeWillChange] PHP attributes to restore PHP 7.4 compatibility
Also add comment on previous #[\ReturnTypeWillChange]
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user