Skip to content

Commit

Permalink
Add support for readonly constructor properties
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Feb 17, 2024
1 parent 01c8320 commit 68df3b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions file.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ public function &get_functions() {
case T_PUBLIC:
case T_PROTECTED:
case T_PRIVATE:
case T_READONLY:
continue 2;
case T_VARIABLE:
// The variale name, adding in the vardiadic if required.
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/phpdoc_constructor_property_promotion.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct(
protected string $name,
protected float|int $size,
protected ?string $description = null,
protected ?string $content = null
protected readonly ?string $content = null
) {
}
}

0 comments on commit 68df3b8

Please sign in to comment.