You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Set a path to a file with custom error callback to `--syntax-error-callback` option.
4
+
1. Create a class implementing `JakubOnderka\PhpParallelLint\Contracts\SyntaxErrorCallback` interface. File with the class must have the same name as the class inside.
5
+
1. Modify error before it is printed to the output.
6
+
7
+
## Configuration
8
+
9
+
File `MyCustomErrorHandler.php` will be passed as an argument like `./parallel-lint --syntax-error-callback ./path/to/MyCustomErrorHandler.php .`.
10
+
The content should look like:
11
+
12
+
```php
13
+
14
+
use JakubOnderka\PhpParallelLint\Contracts\SyntaxErrorCallback;
15
+
use JakubOnderka\PhpParallelLint\SyntaxError;
16
+
17
+
class MyCustomErrorHandler implements SyntaxErrorCallback {
18
+
/**
19
+
* @param SyntaxError $error
20
+
* @return SyntaxError
21
+
*/
22
+
public function errorFound(SyntaxError $error){
23
+
// Return new SyntaxError with custom modification to FilePath or Message
24
+
// Or return completely new SyntaxError extending the original one...
0 commit comments