Integration between psysh and ZF2 The best way to debug your cli command!
PsySH is a runtime developer console, interactive debugger and REPL for PHP. Learn more at psysh.org. Check out the Interactive Debugging in PHP talk from OSCON on Presentate.
composer require gianarb/psysh-module
Your application return a cli command zf-endpoint user list
, How can I debug it?
In the first step you can set a breakpoint into command action. To build it you can use the psysh
service from your service locator
<?php
eval($this->getServiceLocator()->get("psysh")->breakpoint());
Run this command
vendor/bin/zf2-psysh user list
Now you can type in
ls
This command show all variable into the scope