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

[Php80] Returns null on no change on ClassPropertyAssignToConstructorPromotionRector #6418

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Nov 12, 2024

Add $hasChanged flag on loop to verify it to avoid show applied rules on multi rules apply:

➜  CodeIgniter4 git:(develop) ✗ vendor/bin/rector 
 956/956 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
1 file with changes
===================

1) system/Database/Forge.php:572

    ---------- begin diff ----------
@@ @@
             }

             // Most databases don't support creating indexes from within the CREATE TABLE statement
-            if (! empty($this->keys)) {
+            if ($this->keys !== []) {
                 for ($i = 0, $sqls = $this->_processIndexes($table), $c = count($sqls); $i < $c; $i++) {
                     $this->db->query($sqls[$i]);
                 }
    ----------- end diff -----------

Applied rules:
 * SimplifyEmptyCheckOnEmptyArrayRector
 * ClassPropertyAssignToConstructorPromotionRector

@samsonasik samsonasik merged commit d2db35e into main Nov 12, 2024
36 checks passed
@samsonasik samsonasik deleted the return-null-no-change branch November 12, 2024 03:23
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.

1 participant