public static function __set_state($data) { $route = new static($data['methods'], $data['pattern'], $data['controller'], $data['name'], $data['options']); if (static::$router !== null) { static::$router->addCachedRoute($route); } return $route; }