Skip to content

Commit 2b29875

Browse files
committed
Merge branch 'master' into 4.x
2 parents 6d383d2 + df03d8a commit 2b29875

File tree

3 files changed

+292
-0
lines changed

3 files changed

+292
-0
lines changed

src/Files/File.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,6 +1871,7 @@ public function getMethodProperties($stackPtr)
18711871
* 'is_static' => boolean, // TRUE if the static keyword was found.
18721872
* 'is_readonly' => boolean, // TRUE if the readonly keyword was found.
18731873
* 'is_final' => boolean, // TRUE if the final keyword was found.
1874+
* 'is_abstract' => boolean, // TRUE if the abstract keyword was found.
18741875
* 'type' => string, // The type of the var (empty if no type specified).
18751876
* 'type_token' => integer|false, // The stack pointer to the start of the type
18761877
* // or FALSE if there is no type.
@@ -1922,6 +1923,7 @@ public function getMemberProperties($stackPtr)
19221923
T_VAR => T_VAR,
19231924
T_READONLY => T_READONLY,
19241925
T_FINAL => T_FINAL,
1926+
T_ABSTRACT => T_ABSTRACT,
19251927
];
19261928

19271929
$valid += Tokens::SCOPE_MODIFIERS;
@@ -1933,6 +1935,7 @@ public function getMemberProperties($stackPtr)
19331935
$isStatic = false;
19341936
$isReadonly = false;
19351937
$isFinal = false;
1938+
$isAbstract = false;
19361939

19371940
$startOfStatement = $this->findPrevious(
19381941
[
@@ -1980,6 +1983,9 @@ public function getMemberProperties($stackPtr)
19801983
case T_FINAL:
19811984
$isFinal = true;
19821985
break;
1986+
case T_ABSTRACT:
1987+
$isAbstract = true;
1988+
break;
19831989
}//end switch
19841990
}//end for
19851991

@@ -2036,6 +2042,7 @@ public function getMemberProperties($stackPtr)
20362042
'is_static' => $isStatic,
20372043
'is_readonly' => $isReadonly,
20382044
'is_final' => $isFinal,
2045+
'is_abstract' => $isAbstract,
20392046
'type' => $type,
20402047
'type_token' => $typeToken,
20412048
'type_end_token' => $typeEndToken,

tests/Core/Files/File/GetMemberPropertiesTest.inc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,3 +401,27 @@ class AsymVisibility {
401401
/* testPHP84IllegalAsymPublicProtectedSetStaticProperty */
402402
public protected(set) static mixed $prop10;
403403
}
404+
405+
abstract class WithAbstractProperties {
406+
/* testPHP84AbstractPublicTypedProp */
407+
abstract public string $val1 { get; }
408+
/* testPHP84AbstractProtectedTypedProp */
409+
abstract protected Union|Type $val2 { set; }
410+
/* testPHP84AbstractMiddleTypedProp */
411+
public abstract Intersection&Type $val3 { get; }
412+
/* testPHP84AbstractImplicitVisibilityTypedProp */
413+
abstract int $val4 { set; }
414+
/* testPHP84AbstractImplicitVisibilityProp */
415+
abstract $val5 { get; }
416+
/* testPHP84AbstractNullableTypedProp */
417+
abstract public ?string $val6 { set; }
418+
/* testPHP84AbstractComplexTypedProp */
419+
abstract protected (Foo&\Bar)|false $val7 { get; }
420+
421+
/* testPHP84IllegalAbstractPrivateProp */
422+
private abstract string $val8 { get; }
423+
/* testPHP84IllegalAbstractReadonlyProp */
424+
public readonly abstract string $val9 { get; }
425+
/* testPHP84IllegalAbstractStaticProp */
426+
public abstract static string $val10 { get; }
427+
}

0 commit comments

Comments
 (0)