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

[Rector] Clean up skip config and re-run Rector #5813

Merged
merged 8 commits into from
Mar 21, 2022

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Mar 19, 2022

  • Clean up skip config

    • clean unneded skip RemoveUnusedPrivateMethodRector on __DIR__ . '/system/CodeIgniter.php file

    • only specificy on specific files on skip StringClassNameToClassConstantRector due to internal PHPStan issue for detecting namespaced string for and expected string in tests

        - __DIR__ . '/app/Config/Pager.php',
        - __DIR__ . '/app/Config/Validation.php',
        - __DIR__ . '/tests/system/Validation/StrictRules/ValidationTest.php',
        - __DIR__ . '/tests/system/Validation/ValidationTest.php',
        - __DIR__ . '/tests/system/Autoloader/FileLocatorTest.php',
      
  • Re-run Rector

Checklist:

  • Securely signed commits

@samsonasik
Copy link
Member Author

All green 🎉

system/Config/BaseService.php Outdated Show resolved Hide resolved
system/Config/BaseService.php Outdated Show resolved Hide resolved
samsonasik and others added 2 commits March 20, 2022 01:25
Co-authored-by: Mostafa Khudair <59371810+mostafakhudair@users.noreply.github.com>
Co-authored-by: Mostafa Khudair <59371810+mostafakhudair@users.noreply.github.com>
app/Config/Database.php Outdated Show resolved Hide resolved
@kenjis kenjis added the refactor Pull requests that refactor code label Mar 20, 2022
Copy link
Member

@kenjis kenjis left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

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

I'm going to approve this but I still mildly prefer being able to use an un-namespaced class name as a string: 'InvalidArgumentException'. If there's no way to differentiate those the overall benefit outweighs my perturbation. 😊

@@ -830,7 +830,7 @@ protected function startController()
$this->benchmark->start('controller_constructor');

// Is it routed to a Closure?
if (is_object($this->controller) && (get_class($this->controller) === 'Closure')) {
if (is_object($this->controller) && (get_class($this->controller) === Closure::class)) {
Copy link
Member

Choose a reason for hiding this comment

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

There isn't by chance a way to "exempt core classes without namespaces" is there?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not yet, it possibly need to have configured, eg skip_native_class

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

@MGatner I updated to exclude specific native classes 0176bb4

@samsonasik
Copy link
Member Author

I am merging it ;)

@samsonasik samsonasik merged commit 8df0b76 into codeigniter4:develop Mar 21, 2022
@samsonasik samsonasik deleted the clean-up-re-run-rector branch March 21, 2022 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Pull requests that refactor code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants