-
-
Notifications
You must be signed in to change notification settings - Fork 360
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
Move instanceof PHPStan Type to ->is*() take 1 #6416
Conversation
…allRector due undefined method
All checks have passed 🎉 @TomasVotruba I am merging it ;) |
Tested on CodeIgniter 4 project, it somehow cause invalid change on non-native property: ➜ 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 which hsould be skipped, which |
After some check, Lines 5 to 31 in 3949fc2
which property be null is rather rare, I also create a patch on CodeIgniter4 side based on it: |
Cherry-pick from #6415
Ref rectorphp/rector#8815 (comment)