Use a local variable so that the closure works.
PHP < 5.4.0 doesnt support $this in anonymous functions.
Merge pull request #9 from jlas/develop

Use of $this in anonymous function in cli callback