Skip to content

Commit 0da2d66

Browse files
Arshidnikic
authored andcommitted
Support Param isFinal()
1 parent f7c23a4 commit 0da2d66

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/PhpParser/Node/Param.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ public function isPromoted(): bool {
7171
return $this->flags !== 0 || $this->hooks !== [];
7272
}
7373

74+
public function isFinal(): bool {
75+
return (bool) ($this->flags & Modifiers::FINAL);
76+
}
77+
7478
public function isPublic(): bool {
7579
$public = (bool) ($this->flags & Modifiers::PUBLIC);
7680
if ($public) {

test/PhpParser/Node/ParamTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public static function provideModifiers() {
3535
['protected'],
3636
['private'],
3737
['readonly'],
38+
['final'],
3839
];
3940
}
4041

0 commit comments

Comments
 (0)