| Subject | Details |
| :------------- | :---------------------------------------------------------------|
| Rector version | v0.7.33 |
| Installed as | composer dependency |
The rector is trying to rename the properties of a built-in PHP object
- return $result->num_rows;
+ return $result->numRows;
function reproduceBug(mysqli_result $result): int {
return $result->num_rows;
}
This rector should leave the built-in PHP objects alone
Hi,
could yo uprovide minimal failing demo, so we can replicate the issue?
https://getrector.org/demo
Same issue for me too. I'm using CakePHP framework, so when we retrieve the data it returns instance of \Cake\ORM\Entity which includes table rows(which is underscored as db column should be underscored not PascalCase/camelCase) as a property name.
It's good if we separate this one rule into two separate rules like:
1. Rector\CodingStyle\Rector\Variable\UnderscoreToPascalCaseVariableRector
2. Rector\CodingStyle\Rector\Variable\UnderscoreToPascalCasePropertyNameRector
So we have option to enable/disable the rules according to code base.
I see this discussion is already going on in #3436.
Closing as duplicated of #3436
Most helpful comment
Sure can!
https://getrector.org/demo/f312cd88-4d8d-4716-a269-8973a7336fd3#result