Skip to content

Commit e29c200

Browse files
mreidenczosel
authored andcommitted
Support PHP 8.3 typed constants.
Depends on Kenneth-Sills/php-parser#1
1 parent 54532a3 commit e29c200

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/options.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export default {
2323
{ value: "8.0" },
2424
{ value: "8.1" },
2525
{ value: "8.2" },
26+
{ value: "8.3" },
2627
],
2728
},
2829
trailingCommaPHP: {

src/printer.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2308,6 +2308,7 @@ function printNode(path, options, print) {
23082308
node.final ? "final " : "",
23092309
node.visibility ? [node.visibility, " "] : "",
23102310
"const",
2311+
node.type ? [node.nullable ? " ?" : " ", print("type")] : "",
23112312
firstVariable ? [" ", firstVariable] : "",
23122313
indent(printed.slice(1).map((p) => [",", hardline, p])),
23132314
]);

0 commit comments

Comments
 (0)