Replace by-ref with __destruct

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
Kamil Tekiela 2023-12-12 20:20:09 +01:00
parent 60d2f15315
commit 275fa86ffb
3 changed files with 11 additions and 3 deletions

View File

@ -10272,7 +10272,7 @@ parameters:
-
message: "#^Cannot access offset 'favoriteTables'\\|'recentTables' on mixed\\.$#"
count: 3
count: 4
path: src/Favorites/RecentFavoriteTable.php
-
@ -10282,7 +10282,7 @@ parameters:
-
message: "#^Cannot access offset mixed on mixed\\.$#"
count: 3
count: 4
path: src/Favorites/RecentFavoriteTable.php
-

View File

@ -5936,6 +5936,8 @@
</MixedArrayAccess>
<MixedArrayAssignment>
<code><![CDATA[$_SESSION['tmpval'][$this->tableType->value . 'Tables']]]></code>
<code><![CDATA[$_SESSION['tmpval'][$this->tableType->value . 'Tables']]]></code>
<code><![CDATA[$_SESSION['tmpval'][$this->tableType->value . 'Tables'][$serverId]]]></code>
<code><![CDATA[$_SESSION['tmpval'][$this->tableType->value . 'Tables'][$serverId]]]></code>
</MixedArrayAssignment>
<MixedAssignment>

View File

@ -71,7 +71,13 @@ class RecentFavoriteTable
: [];
}
$this->tables =& $_SESSION['tmpval'][$this->tableType->value . 'Tables'][$serverId];
$this->tables = $_SESSION['tmpval'][$this->tableType->value . 'Tables'][$serverId];
}
public function __destruct()
{
$serverId = $GLOBALS['server'];
$_SESSION['tmpval'][$this->tableType->value . 'Tables'][$serverId] = $this->tables;
}
/**