plugin-php
plugin-php copied to clipboard
Comment in function parameters causes all attributes to be deleted
@prettier/plugin-php v0.19.2 Playground link
Input:
<?php
#[ATTRIBUTE]
function aaa(
int $bbb,
// this comment causes attribute to dissappear
int $ccc,
) {
var_dump('test');
}
Output:
<?php
function aaa(
int $bbb,
// this comment causes attribute to dissappear
int $ccc,
) {
var_dump("test");
}
It looks to be a regression on v0.19.2, however, I am not that familiar with the way comments are parsed/handled.