Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

分岐が正しく機能しない #1

Open
kento-oka opened this issue Dec 27, 2017 · 0 comments
Open

分岐が正しく機能しない #1

kento-oka opened this issue Dec 27, 2017 · 0 comments

Comments

@kento-oka
Copy link
Owner

同様の文字列にマッチする記述方法が異なるルールを複数追加すると、一番最初にマッチしたルールだけでしか判定を行わない。

$route->addShortRegex("d", new NaturalNumber());
$router->get("/users/{id:[1-9][0-9]*}/", []);
$router->get("/users/{id:|d}/profile/", []);

$router->search("GET", "/users/123/");            // Not Found
$router->search("GET", "/users/123/profile");  // Found

これの解決にはツリーの探索アルゴリズムを追加する必要がある。

深さ優先探索でいいと考えているが、その実装方法を思案中である。

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant