Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Files/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -1845,6 +1845,7 @@ public function getMethodProperties($stackPtr)
* 'scope_specified' => boolean, // TRUE if the scope was explicitly specified.
* 'is_static' => boolean, // TRUE if the static keyword was found.
* 'is_readonly' => boolean, // TRUE if the readonly keyword was found.
* 'is_final' => boolean, // TRUE if the final keyword was found.
* 'type' => string, // The type of the var (empty if no type specified).
* 'type_token' => integer|false, // The stack pointer to the start of the type
* // or FALSE if there is no type.
Expand Down Expand Up @@ -1917,6 +1918,7 @@ public function getMemberProperties($stackPtr)
T_STATIC => T_STATIC,
T_VAR => T_VAR,
T_READONLY => T_READONLY,
T_FINAL => T_FINAL,
];

$valid += Tokens::$emptyTokens;
Expand All @@ -1925,6 +1927,7 @@ public function getMemberProperties($stackPtr)
$scopeSpecified = false;
$isStatic = false;
$isReadonly = false;
$isFinal = false;

$startOfStatement = $this->findPrevious(
[
Expand Down Expand Up @@ -1960,6 +1963,8 @@ public function getMemberProperties($stackPtr)
case T_READONLY:
$isReadonly = true;
break;
case T_FINAL:
$isFinal = true;
}
}//end for

Expand Down Expand Up @@ -2016,6 +2021,7 @@ public function getMemberProperties($stackPtr)
'scope_specified' => $scopeSpecified,
'is_static' => $isStatic,
'is_readonly' => $isReadonly,
'is_final' => $isFinal,
'type' => $type,
'type_token' => $typeToken,
'type_end_token' => $typeEndToken,
Expand Down
5 changes: 5 additions & 0 deletions tests/Core/File/GetMemberPropertiesTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -354,3 +354,8 @@ trait DNFTypes {
// Intentional fatal error - nullable operator cannot be combined with DNF.
var ?(A&\Pck\B)|bool $propD;
}

class WithFinalProperties {
/* testPHP84FinaProperty */
final public string $val;
}
Loading
Loading