You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working mostly CLI centric applications (Box, PHP-Scoper, Infection), I have always been frustrated with a couple of points regarding symfony/console.
After years of trying to ignore this, it finally reached the tipping point and I decided to write fidry/console.
The initial promise is:
Make the API more transparent: there is clear, documented interfaces. No more extending a 600-1200 LoC base class with sometimes hard to find hooks
A typed API: the input arguments and options can be accessed via a rich typed API which goes beyond providing a type information, but also does check if the type coercion makes sense. A concrete example, you want a natural argument. At the end of the day the input is a user-based input so anything (physically possible) can be given. For an argument it is null|string|list<string>. With the typed API, you can easily coerce it to a natural value (PHPStan/Psalm compatible) whilst failing gracefully, providing a helpful message to the user when the input is incorrect.
A few utilities (IO object, CommandTester, ApplicationTester) to make your life easier.
I designed the library with goal to merge it back to Symfony eventually and I'm working with @chalasr for that, but that will realistically take a while. As a result though, the library can be seen as a very thing layer on top of the Symfony console as opposed to competing with it.
Anyway, the library has now been merged both in Box (see box-project/box#646) and PHP-Scoper (humbug/php-scoper#480 – earlier version and less clean probably in terms of PR). I'll be happy to do a PR for Infection as well if you are interested.
The text was updated successfully, but these errors were encountered:
While working mostly CLI centric applications (Box, PHP-Scoper, Infection), I have always been frustrated with a couple of points regarding
symfony/console
.After years of trying to ignore this, it finally reached the tipping point and I decided to write
fidry/console
.The initial promise is:
null|string|list<string>
. With the typed API, you can easily coerce it to a natural value (PHPStan/Psalm compatible) whilst failing gracefully, providing a helpful message to the user when the input is incorrect.IO
object,CommandTester
,ApplicationTester
) to make your life easier.I designed the library with goal to merge it back to Symfony eventually and I'm working with @chalasr for that, but that will realistically take a while. As a result though, the library can be seen as a very thing layer on top of the Symfony console as opposed to competing with it.
Anyway, the library has now been merged both in Box (see box-project/box#646) and PHP-Scoper (humbug/php-scoper#480 – earlier version and less clean probably in terms of PR). I'll be happy to do a PR for Infection as well if you are interested.
The text was updated successfully, but these errors were encountered: