I have some custom functions (in a custom plugin) that work perfectly fine normally but throw warnings in CLI. And I’m wondering if it’s something I just have to accept or if I should modify my functions.
The function uses an array that I define in a different file in the plugin. Where the warning is, I make the array global and iterate through it. Again, this works fine normally. But when I use CLI, I get this warning: “foreach() argument must be of type array|object, null given”.
Is that just the way it is and I should accept it?
Is there something I should do differently?
Personally, I’m not worried about it. But my non-WP boss is (mildly) concerned that there are new warnings.