Skip to content

Commit d474187

Browse files
committed
docs: improve comment
1 parent 96de786 commit d474187

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

system/Router/AutoRouterImproved.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -519,13 +519,15 @@ private function checkUriForMethod(string $method): void
519519
return;
520520
}
521521

522-
// If `getSomeMethod()` exists, only `controller/some-method` should be
523-
// accessible. But if a visitor navigates to `controller/somemethod`,
524-
// `getSomemethod()` will be checked, and method_exists() will return true.
525522
if (
523+
// For example, if `getSomeMethod()` exists in the controller, only
524+
// the URI `controller/some-method` should be accessible. But if a
525+
// visitor navigates to the URI `controller/somemethod`, `getSomemethod()`
526+
// will be checked, and `method_exists()` will return true because
527+
// method names in PHP are case-insensitive.
526528
method_exists($this->controller, $method)
527-
// We do not permit `controller/somemethod`, so check the exact method
528-
// name.
529+
// But we do not permit `controller/somemethod`, so check the exact
530+
// method name.
529531
&& ! in_array($method, get_class_methods($this->controller), true)
530532
) {
531533
throw new PageNotFoundException(

0 commit comments

Comments
 (0)