Skip to content

Commit cbc35b3

Browse files
committed
Compare the class with get_class() for PHP 7.4
simple-downgrade does not rewrite `$object::class`, which needs PHP 8.0. Amp-Thread-ID: https://ampcode.com/threads/T-01a1c574-f264-7659-8779-5e71ca99b89b
1 parent 31f6bc8 commit cbc35b3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎src/Type/IntersectionType.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
use function array_unique;
6464
use function array_values;
6565
use function count;
66+
use function get_class;
6667
use function implode;
6768
use function in_array;
6869
use function is_int;
@@ -326,7 +327,7 @@ public function isSuperTypeOf(Type $otherType): IsSuperTypeOfResult
326327
return IsSuperTypeOfResult::createYes();
327328
}
328329

329-
if ($otherType::class === MixedType::class && $otherType->getSubtractedType() === null) {
330+
if (get_class($otherType) === MixedType::class && $otherType->getSubtractedType() === null) {
330331
// Immutable, so it compares to plain mixed the same way every time -
331332
// remembered because comparing to mixed walks every nested member,
332333
// and a member shared by several nested types (e.g. a snapshot of

0 commit comments

Comments
 (0)