Skip to content

Commit 6d6b0eb

Browse files
committed
File::getMemberProperties(): add tests with PHP 8 "mixed" property type
No changes needed to the actual method, the property type is already handled correctly.
1 parent 17b2c66 commit 6d6b0eb

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

tests/Core/File/GetMemberPropertiesTest.inc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,12 @@ function_call( 'param', new class {
179179
/* testNestedMethodParam 2 */
180180
public function __construct( $open, $post_id ) {}
181181
}, 10, 2 );
182+
183+
class PHP8Mixed {
184+
/* testPHP8MixedTypeHint */
185+
public static miXed $mixed;
186+
187+
/* testPHP8MixedTypeHintNullable */
188+
// Intentional fatal error - nullability is not allowed with mixed, but that's not the concern of the method.
189+
private ?mixed $nullableMixed;
190+
}

tests/Core/File/GetMemberPropertiesTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,26 @@ public function dataGetMemberProperties()
459459
'nullable_type' => false,
460460
],
461461
],
462+
[
463+
'/* testPHP8MixedTypeHint */',
464+
[
465+
'scope' => 'public',
466+
'scope_specified' => true,
467+
'is_static' => true,
468+
'type' => 'miXed',
469+
'nullable_type' => false,
470+
],
471+
],
472+
[
473+
'/* testPHP8MixedTypeHintNullable */',
474+
[
475+
'scope' => 'private',
476+
'scope_specified' => true,
477+
'is_static' => false,
478+
'type' => '?mixed',
479+
'nullable_type' => true,
480+
],
481+
],
462482
];
463483

464484
}//end dataGetMemberProperties()

0 commit comments

Comments
 (0)