/**
* Create and return an application event instance
*
* Sets the target to the App object instance, and, if a route has been
* matched, adds it to the instance.
*
* @return AppEvent
*/
public function event()
{
$event = new AppEvent();
$event->setTarget($this);
if (-1 < $this->routeIndex) {
$route = $this->routes[$this->routeIndex];
$event->setRoute($route);
}
return $event;
}