cebe / php-openapi

Read and write OpenAPI yaml/json files and make the content accessible in PHP objects.
MIT License
466 stars 88 forks source link

Move to symfony console #64

Closed vv12131415 closed 3 years ago

vv12131415 commented 4 years ago

I think it will be easier to manage things if you move to symfony console (with is de-facto standard for the console apps in php).

cebe commented 4 years ago

what exactly is easier? It will add another dependency on a symfony component, making it harder to use the library with different symfony versions.

vv12131415 commented 4 years ago

1) this file will https://github.com/cebe/php-openapi/blob/master/bin/php-openapi will look OO way 2) you can do the same thing as you did with symfony/yaml https://github.com/cebe/php-openapi/blob/98fedafe3827188610564dee18e4d09ab08ddbbb/composer.json#L23

TroodoNmike commented 3 years ago

I also think this is good idea. It would help collaborate on the same command format like in other php applications. At the moment bin/php-openapi looks like its trying to re-invent the wheel. I know it looks small and simple but it probably does not handle many edge cases. Please dont take it as a must thing from my side, its just a recommendation. Here is component documentation https://symfony.com/doc/current/components/console.html

cebe commented 3 years ago

you can do the same thing as you did with symfony/yaml

such a strategy would require symfony console API to be stable among major versions. This works quite okay for Yaml as there are only two method calls relevant for us. Symfony consoles API is much more complex and might introduce breaking changes making it hard to adapt to new symfony versions. This package should be installable regardless of the Symfony version so I will not add another dependency that can cause problems with breaking changes.