/**
  * @param  string                   $event
  * @param  array                    $args
  * @return false|ResponseCollection
  */
 public function trigger($event, array $args = null)
 {
     if (!empty($this->listeners[$event])) {
         $responseCollection = new ResponseCollection();
         foreach ($this->listeners[$event] as $cmd) {
             $result = call_user_func_array($cmd, (array) $args);
             $response = new Response($cmd, $result);
             $responseCollection->add($response);
         }
         return $responseCollection;
     }
     return false;
 }
 public function setUp()
 {
     $collection = new ResponseCollection();
     $cmds = array();
     foreach (range(1, 3) as $num) {
         $cmd = new Command(function () use($num) {
             return $num;
         });
         $cmds[] = $cmd;
         $response = new Response($cmd, $num);
         $collection->add($response);
     }
     $this->collection = $collection;
     $this->cmds = $cmds;
 }