Skip to content

Commit 322bb8c

Browse files
committed
Fixing PHP 7.4 Weakrefs
1 parent 3850c56 commit 322bb8c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ parameters:
1111
- "#expects array<string>, array<int, int|string> given.#"
1212
- "/Parameter #. \\$types of method Doctrine\\\\DBAL\\\\Connection::.*() expects array<int|string>, array<int, Doctrine\\\\DBAL\\\\Types\\\\Type> given./"
1313
- "#Method TheCodingMachine\\\\TDBM\\\\Schema\\\\ForeignKey::.*() should return .* but returns array<string>|string.#"
14+
- '#Method TheCodingMachine\\TDBM\\NativeWeakrefObjectStorage::get\(\) should return TheCodingMachine\\TDBM\\DbRow\|null but returns object\|null.#'
1415
-
1516
message: '#Result of && is always false.#'
1617
path: src/Test/Dao/Bean/Generated/ArticleBaseBean.php

src/NativeWeakrefObjectStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private function cleanupDanglingWeakRefs(): void
9898
{
9999
foreach ($this->objects as $tableName => $table) {
100100
foreach ($table as $id => $obj) {
101-
if ($obj->valid() === false) {
101+
if ($obj->get() === null) {
102102
unset($this->objects[$tableName][$id]);
103103
}
104104
}

0 commit comments

Comments
 (0)