flipboxstudio / lumen-generator

A Lumen Generator You Are Missing
https://packagist.org/packages/flipbox/lumen-generator
MIT License
822 stars 126 forks source link

RouteListCommand.php implode wrong order #64

Closed pieczarkazsolt closed 4 years ago

pieczarkazsolt commented 4 years ago

Hi, I found a tiny bug in the code: #62 'verb' => implode($innerRoute->getMethods(), '|'), #67 'middleware' => implode($innerRoute->getMiddleware(), '|'), and in php docs: implode ( string $glue , array $pieces ) : string (https://www.php.net/manual/en/function.implode.php)

joelhy commented 4 years ago

Won't fix. According to https://www.php.net/manual/en/function.implode.php:

Note:

implode() can, for historical reasons, accept its parameters in either order. For consistency with explode(), however, it may be less confusing to use the documented order of arguments.

For example:

>>> implode(',', [1,2]);
=> "1,2"
>>> implode([1,2], ',');
=> "1,2"
pieczarkazsolt commented 4 years ago

ok guy. i accept the answer, but: https://www.php.net/manual/en/migration74.deprecated.php. and the code isn't consistent, becaue in Console/GeneratorCommand.php use this order: implode(',', [1,2]);

joelhy commented 4 years ago

Got it. PHP 7.4 compatibility will be considered, and this will be fixed.