function agents($uri = NULL) { return array_filter($this->agents, function ($val) use($uri) { return $uri ? $val->uri() == $uri : TRUE; }); }