Plugin-php: broken phpdoc for closures

Created on 13 May 2020  路  2Comments  路  Source: prettier/plugin-php

@prettier/plugin-php v0.14.0
Playground link

Input:

<?php

$foo = /**
* @param array{a: int, b: string} $bar
*/
static fn (array $bar) => $bar;

Output:

<?php

$foo /**
 * @param array{a: int, b: string} $bar
 */ = static fn(array $bar) => $bar;

Expected:

<?php

$foo = /**
* @param array{a: int, b: string} $bar
*/
static fn (array $bar) => $bar;

Hi, I am using psalm, and currently it is not possible to use psalm annotations for closures due to this bug.

bug comments

All 2 comments

I see, thanks for reporting this!

We just released v0.14.2 which fixes this :tada:

Was this page helpful?
0 / 5 - 0 ratings