@jajaX
Question:
Is Cops compatible with php 8 ?
Answer:
NO, not with the original code from https://github.com/seblucas/cops
However (
YES) if you are willing to dive into the code and edit 1 line. Then COPS should work with PHP 8 (never tried with PHP 8.2).
Reference:
https://github.com/seblucas/cops/issues/492
How:
1 - open file ../cops/vendor/seblucas/dot-php/doT.php
2 - change line 94
Code:
return @create_function ('$it', $func);
3 - to
Code:
return @function ($it) use ($func) {
return eval($func);
};
I did it like this:
Code:
// For PHP 8 replace this line
//return create_function ('$it', $func);
// with
return function ($it) use ($func) {
return eval($func);
};
// end replace
Please report back if it works for you.