To add the sometimes needed configurability, in PhpStorm 2018.1 we’ve added the list of exceptions to be excluded from analysis. Only the equivalent transformations are performed, and the logic of your code does not change. These will convert loops into the array_map, array_filter and array_fill function calls, and vice versa. The new Inline refactoring will help you with all of the above.
This can be tricky in some cases since you'll need to handle multiple function calls, maintain proper variables' scopes and default values, and reformat the resulting code. Inline function/method refactoring - Using the method’s body in your code can sometimes be more practical than using the method itself, in which case you will need to replace the calls to the method with the actual method’s content.