8000 fix: RenamePropertyToMatchTypeRector renames DateTimeInterface by tony-stark-eth · Pull Request #6814 · rectorphp/rector-src · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: RenamePropertyToMatchTypeRector renames DateTimeInterface #6814

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

Merged
merged 4 commits into from
Apr 3, 2025

Conversation

tony-stark-eth
Copy link
Contributor
@tony-stark-eth tony-stark-eth commented Apr 2, 2025

Without this rector changes DateTimeInterface names.

> vendor/bin/rector '--dry-run' '--clear-cache'
 23/23 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
1 file with changes
===================

1) src/Entity/SomeEntity.php:19

    ---------- begin diff ----------
@@ @@
     private null|int $id = null;

     #[ORM\Column(type: Types::DATETIME_MUTABLE)]
-    private DateTimeInterface $someDateName;
+    private DateTimeInterface $dateTime;

@@ @@
         null|DateTimeInterface $someDateName = null
     ) {
-        $this->someDateName = $someDateName ?? \Carbon\CarbonImmutable::now();
+        $this->someDateName = $someDateName ?? \Carbon\CarbonImmutable::now();
     }

@TomasVotruba
Copy link
Member

Thanks for the fix. Could you add a test fixture as well? I recall we had this fixed before, so just to avoid any regressions in the future.

@tony-stark-eth
Copy link
Contributor Author

Thanks for the fix. Could you add a test fixture as well? I recall we had this fixed before, so just to avoid any regressions in the future.

Yeah there is a fixture in rules-tests/Naming/Rector/Class_/RenamePropertyToMatchTypeRector/Fixture/skip_date_time.php.inc but I couldn't figure out yet why it is not exposing the issue.

@samsonasik samsonasik merged commit 59d3529 into rectorphp:main Apr 3, 2025
45 checks passed
@samsonasik
Copy link
Member

Thank you @tony-stark-eth

@TomasVotruba
Copy link
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0