working on php 8.2 compat for CI3, phpstan errors different on macos |
Because CI4 is such a huge leap from CI3, I am trying to expedite the work to make CI3 compatible with PHP 8.2. This is mostly about fixing dynamically assigned class properties, which were deprecated in 8.2. I'm using phpstan for static analysis and it seems quite helpful. Unfortunately, I'm getting a LOT more errors on MacOS than on Ubuntu, even when both are running PHP 8.2.3. I've provided more detail on a SO post a stack overflow post, but the basic idea is that I can perform these exact same steps on Ubuntu and MacOS and get different error reports because PHPstan fails to see the CI_DB class declaration on MacOS for some reason.
If anyone could tell me why and help me sort this out, I'd appreciate it. These are the steps: Code: mkdir ci3-dev
I have not been able to isolate why the number of errors is different on MacOS versus Ubuntu, but I made a small change to system/database/DB.php and this reduced the number of errors reported by phpstan from about 1830 to about 1000 -- it literally eliminated 800 errors, and it should be more efficient as well. It has always been weird that CI3 defined the CI_DB class inside a conditional that was inside a function.
|
Welcome Guest, Not a member yet? Register Sign In |