goaop / framework

:gem: Go! AOP PHP - modern aspect-oriented framework for the new level of software development
go.aopphp.com
MIT License
1.66k stars 163 forks source link

[PHP8] Add broken test with failing attributes generation #502

Open lisachenko opened 5 months ago

lisachenko commented 5 months ago

This broken test is used to track issue with broken codogen with attributes near class/method/method/function/property/parameter.

scrutinizer-notifier commented 5 months ago

A new inspection was created.

lisachenko commented 5 months ago

Blocked on https://github.com/laminas/laminas-code/pull/145

lisachenko commented 5 months ago

FYI @samsonasik this issues is considered as main blocker for running on codebase with attributes - child class won't contain any attributes and this breaks the logic of clients who expect attributes to be preserved.

lisachenko commented 5 months ago

One solution can be switch to something under our control (I doubt that I'll have enough resources to support this).

Another solution is to completely remove dependency on laminas package and instead use PrettyPrinter and AST nodes from the nikic/php-parser via BuilderFactory::attribute and similar to generate new code.

samsonasik commented 5 months ago

@lisachenko I am currently on my village and will be back on 16th/17th April, so hopefully can fully looking at it after that day as possibly 2 days long trip.

Ceate own builder for it can be solution, but need to check how many laminas-code already involved in other area

samsonasik commented 3 months ago

@lisachenko it seems too tight with laminas-code, and for the alternative, to be able to use php-parser's Printer, we need to know the Node from the ReflectionFunction which may need to use Go\ParserReflection\ReflectionFunction, since Function_ parameter is required, we may scan from very early with Go\ParserReflection\ReflectionFileNamespace, I don't have idea how big the refactor it can be, any idea?