On Fri, Aug 23, 2024 at 4:27 PM Larry Garfield <la...@garfieldtech.com>
wrote:

> Moving those definitions to attributes is certainly possible, though AFAIK
> both the PHPStan and Psalm devs have expressed zero interest in it.
>
Part of the challenge is that such an approach will either still involve
> string parsing,


That's not really a challenge and would help somewhat with the current
status quo where we have to guess where the type ends and the textual part
of the comment begins. But it gets ugly for any type that has to include
quotes (literal strings, array keys, etc). Technically one can use nowdocs,
but it's not much better:  https://3v4l.org/4hpte


> or will involve a lot of deeply nested attribute classes.


Yeah, that would look like Lisp's S-exprs, but much worse - which, in my
opinion, would harm adoption.

All in all, in my opinion attribute-based solutions are less ergonomic than
what we already have now in docblocks.

-- 
  Best regards,
      Bruce Weirdan                                     mailto:
weir...@gmail.com

Reply via email to