annotations: false still strips some annotations
Bug report
| Question | Answer |
|---|---|
| Box version | 3.13.0 |
| PHP version | 7.4 |
| Platform with version | Ubuntu |
| Github Repo | - |
I'd like to prevent annotations from being stripped by the PHP compactor. Specifying "annotations": false works to a degree, but still strips parts of annotations.
Specifically:
class Foo {
/**
* A foo version.
*
* @var string
*
* @JMS\Type("string")
*/
private $version;
Even with "annotations": false becomes compacted as:
class Foo {
/**
@var
@JMS\Type("string")
*/
private $version;
Notice that this preserves @var but still strips the data type, which unfortunately breaks things such as the JMS serializer (leading to errors like "You must define a type for $version").
Hm there is something fishy there: if there is no annotation compacting then the phpdoc should be left alone, which doesn't appear to be the case here
Fishy indeed, that's why I posted the bug report 😄
Here's a minimum failing example where you can see the same bad behavior: https://github.com/danepowell/box-566