1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Command\ErrorFormatter;
4:
5: use PHPStan\Command\AnalysisResult;
6: use PHPStan\Command\Output;
7:
8: /**
9: * This is the interface custom error formatters implement. Register it in the configuration file
10: * like this:
11: *
12: * ```
13: * services:
14: * errorFormatter.myFormat:
15: * class: App\PHPStan\AwesomeErrorFormatter
16: * ```
17: *
18: * Learn more: https://phpstan.org/developing-extensions/error-formatters
19: *
20: * @api
21: */
22: interface ErrorFormatter
23: {
24:
25: /**
26: * Formats the errors and outputs them to the console.
27: *
28: * @return int Error code.
29: */
30: public function formatErrors(
31: AnalysisResult $analysisResult,
32: Output $output,
33: ): int;
34:
35: }
36: