Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: 404 controller also can get PageNotFoundException message #8491

Merged

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Feb 1, 2024

Description
Closes #8485

In the current implementation, 404 closure can get the PageNotFoundException message as a parameter,
but 404 controller can't.

This PR enables 404 controller to get the messsage as the first parameter.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide


class Errors extends Controller
{
public function show404(string $message)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public function show404(string $message)
public function show404(string $message): string

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@kenjis kenjis force-pushed the feat-404-controller-gets-exception-message branch from 867f6c1 to 33c241c Compare February 2, 2024 01:28
@kenjis
Copy link
Member Author

kenjis commented Feb 2, 2024

Added changelog.

@kenjis kenjis force-pushed the feat-404-controller-gets-exception-message branch from 33c241c to ff3a05a Compare February 2, 2024 06:45
@kenjis kenjis force-pushed the feat-404-controller-gets-exception-message branch from ff3a05a to 8c09f34 Compare February 4, 2024 02:03
@kenjis kenjis merged commit 1151d81 into codeigniter4:4.5 Feb 4, 2024
47 checks passed
@kenjis kenjis deleted the feat-404-controller-gets-exception-message branch February 4, 2024 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.5 enhancement PRs that improve existing functionalities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants