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

fix: route key lowercase HTTP verbs #8235

Merged
merged 22 commits into from
Nov 26, 2023
Merged

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Nov 20, 2023

Description
Follow-up #8186

  • use uppercase HTTP verbs in routes array
  • use uppercase HTTP verbs in FeatureTestTrait::call()

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

@kenjis kenjis added bug Verified issues on the current code behavior or pull requests that will fix them 4.5 breaking change Pull requests that may break existing functionalities and removed breaking change Pull requests that may break existing functionalities labels Nov 20, 2023
@kenjis kenjis changed the title fix: route key HTTP verbs fix: route key lowercase HTTP verbs Nov 20, 2023
@kenjis kenjis force-pushed the fix-route-HTTP-verb branch 2 times, most recently from e4f32df to 5e7c0a4 Compare November 20, 2023 05:06
Copy link
Member

@michalsn michalsn left a comment

Choose a reason for hiding this comment

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

What does suppressing the trigger_error() gives us?

@kenjis
Copy link
Member Author

kenjis commented Nov 21, 2023

I don't know. cs-fixer adds @.

@paulbalandan
Copy link
Member

This allows it to be catched by the error handler and saved in the logs.

@kenjis
Copy link
Member Author

kenjis commented Nov 22, 2023

The error handler always catches the error.

It changes the return value of error_reporting().

--- a/system/Debug/Exceptions.php
+++ b/system/Debug/Exceptions.php
@@ -197,6 +197,8 @@ class Exceptions
      */
     public function errorHandler(int $severity, string $message, ?string $file = null, ?int $line = null)
     {
+        dd($severity, error_reporting());
+
         if ($this->isDeprecationError($severity)) {
             if (! $this->config->logDeprecations || (bool) env('CODEIGNITER_SCREAM_DEPRECATIONS')) {
                 throw new ErrorException($message, 0, $severity, $file, $line);

With @:

$severity integer 16384
error_reporting() integer 4437

Without @:

$severity integer 16384
error_reporting() integer -1

Copy link
Member

@michalsn michalsn left a comment

Choose a reason for hiding this comment

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

Thanks for the explanation, guys!

@kenjis kenjis merged commit 59fa588 into codeigniter4:4.5 Nov 26, 2023
46 checks passed
@kenjis kenjis deleted the fix-route-HTTP-verb branch November 26, 2023 20:39
@kenjis kenjis mentioned this pull request Dec 10, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.5 bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants