Commit 7af643f
PHP 8.1: fix deprecation notice [2]
The `Fixer::generateDiff()` method calls the `shell_exec()` method to retrieve the `diff` between two files.
In the unit tests, this is used to compare the expected content in a `.fixed` file with the generate fixed file contents.
If the expected content matches the generated content, the diff command will produce no output and `shell_exec()` will return `null`.
Ref: https://www.php.net/manual/en/function.shell-exec.php
This result is subsequently passed to `explode()` as the second parameter, but `explode()` only excepts strings as the second parameter.
Ref: https://www.php.net/manual/en/function.explode
As of PHP 8.1, this will generate a deprecation notice `explode(): Passing null to parameter #2 ($string) of type string is deprecated`.
Discovered while testing an external standard against PHPCS `master` on PHP 8.1.
Fixed now.1 parent 6614feb commit 7af643f
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
253 | 257 | | |
254 | 258 | | |
255 | 259 | | |
| |||
0 commit comments