phpstan / phpdoc-parser

Next-gen phpDoc parser with support for intersection types and generics
MIT License
1.35k stars 61 forks source link

Union operator on a new line causes parsing error #183

Open internalsystemerror opened 1 year ago

internalsystemerror commented 1 year ago

Original issue: https://github.com/phpstan/phpstan/issues/9019

When we have a type defined such as

/**
 * @phpstan-type FactoriesConfigurationType = array<
 *      string,
 *      (class-string<Factory\FactoryInterface>|Factory\FactoryInterface)
 *      |callable(ContainerInterface,?string,?array<mixed>|null):object
 * >
 */

We get an error Unexpected token "|", expected '>'. According to the original issue the problem is caused by this package.