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: Routing::loadRoutes() in windows do not validate correctly $routesFiles #7930

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

pjsde
Copy link
Contributor

@pjsde pjsde commented Sep 12, 2023

This occours because the argument definition is string $routesFile = APPPATH . 'Config/Routes.php' (using an slash /) and in the constructor $this->routeFiles is initialized with realpath($routesFile).

When validating if $routesFile exist in the $routeFiles array it do not exist, so add it to the $routeFiles[] duplicating the path.

expected:

$routeFiles = [
    0 => 'D:\projects\tests\app\Config\Routes.php',
];

result:

$routeFiles = [
    0 => 'D:\projects\tests\app\Config\Routes.php',
    1 => 'D:\projects\tests\app\Config/Routes.php',
];

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 the bug Verified issues on the current code behavior or pull requests that will fix them label Sep 12, 2023
@MGatner
Copy link
Member

MGatner commented Sep 12, 2023

PHPStan
1687 Short ternary operator is not allowed.

Since when? That doesn't seem right.

@samsonasik
Copy link
Member

@MGatner that ignored message to be removed from baseline

@pjsde pjsde force-pushed the fix-routing branch 2 times, most recently from 00b4aff to 193e14d Compare September 14, 2023 08:48
@kenjis kenjis merged commit 689c933 into codeigniter4:develop Sep 15, 2023
60 of 61 checks passed
@kenjis
Copy link
Member

kenjis commented Sep 15, 2023

@pjsde Thank you!

@pjsde pjsde deleted the fix-routing branch September 16, 2023 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants