route = $route; $this->rules = $applyRules; } /** * @return Route */ public function getRoute() { return $this->route; } /** * @return array */ public function getRules() { return $this->rules; } /** * {@inheritdoc} */ public function offsetExists($offset) { return is_callable([$this, 'get' . ucfirst($offset)]); } /** * {@inheritdoc} */ public function offsetGet($offset) { return call_user_func([$this, 'get' . ucfirst($offset)]); } /** * {@inheritdoc} */ public function offsetSet($offset, $value) { $this->$offset = $value; } /** * {@inheritdoc} */ public function offsetUnset($offset) { $this->$offset = null; } }