contributte / apitte

:wrench: An opinionated and enjoyable API framework based on Nette Framework. Supporting content negotiation, debugging, middlewares, attributes, annotations and loving openapi/swagger.
https://contributte.org/packages/contributte/apitte/
MIT License
61 stars 37 forks source link

[PHP 8] Fixup attributes features based on use in practise #163

Closed TomasVotruba closed 2 years ago

TomasVotruba commented 2 years ago

This fixes previously nested annotation, that are now attributes that were not parsed correctly:

class SomeController
{

    #[Response('some_description', code: 'cz')]
    #[Response(description: 'some_description_2', code: 'com')]
    public function responses(): void
    {
    }

    #[RequestParameter(name: 'name_value', type: 'type_value', in: 'in_value')]
    #[RequestParameter(in: 'in_value_2', type: 'type_value_2', name: 'name_value_2')]
    public function requestParameters(): void
    {
    }

    #[Negotiation('some_suffix')]
    #[Negotiation(suffix: 'some_suffix_2')]
    public function negotiations(): void
    {
    }

}

Follow up to https://github.com/apitte/core/pull/161

TomasVotruba commented 2 years ago

This is ready to merge now :+1:

f3l1x commented 2 years ago

Thank you :-)

TomasVotruba commented 2 years ago

You're welcome :+1:

I really like how tests are written very precisely. Upgrading code was very intuitive thanks to exact failing messages, great job :clap: