bobthecow/psysh

Commands inside psysh incorrectly parsed

amadeann opened this issue · 3 comments

Version: v0.11.1

Steps To Reproduce:

  1. Open psysh
  2. type exit

Expected: Tinker closes with Exit: Goodbye
Actual: RuntimeException with message 'Too many arguments, expected arguments "command".'

From what I see, it most likely caused by the change in symfony/console (line 27) commited 10 days ago:
symfony/console@aa58a69

Because of that change Psy\Input\ShellInput::tokenize() is not able to correctly parse arguments. Instead of catching the entire "exit" string, it parses it letter by letter.

I believe this is fixed by symfony/symfony#45240

When I typed 'exit' in tinker, it shows error message > RuntimeException with message 'Too many arguments, expected arguments "command".'
But I typed 'exit;' with semi-colon, it's ok and shows > Exit: Goodbye

Yep, that's expected. It is because (inside PsySH) exit is a command, but exit; is PHP code. The Symfony Console issue only affects commands, not code, in PsySH.