Skip to content

Commit f12ef73

Browse files
committedJan 13, 2019
Merge branch 'master' of github.com:noximo/easycodingstandard-fileoutput
2 parents 2ab6586 + 277e53b commit f12ef73

File tree

2 files changed

+28
-27
lines changed

2 files changed

+28
-27
lines changed
 

‎README.md

+27-26
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,45 @@
1-
# PHPStan FileOutput
2-
An error formatter for [Easy Coding Standard](https://github.com/phpstan/phpstan) that exports analysis result into HTML file
1+
# Easy Coding Standard FileOutput
2+
An error formatter for [Easy Coding Standard](https://github.com/Symplify/EasyCodingStandard) that exports analysis result into HTML file
33

44
## Installation
55
```
6-
composer require noximo/phpstan-fileoutput
6+
composer require noximo/easycodingstandard-fileoutput
77
```
88

9-
## Usage
10-
Edit or create your phpstan.neon file and register new error formatter.
11-
First two parameters are mandatory.
9+
## Setup
10+
Edit or create your ecs.ym file and register new output formatter.
11+
12+
- $outputFile - path to file where analysis will be outputted (required)
1213

13-
- First specifies path to file in which data will be outputed.
14+
- $defaultFormatter - specifies which other formatter will be used with FileOutput formatter running silently in the background. You can leave it unsetted if you wish to only work with FileOutput-generated files. (optional)
1415

15-
- Second specifies which other formatter will be used with FileOutput formatter running silently in the background. You can set it to null if you wish to only work with FileOutput-generated files.
16+
- $customTemplate - this argument sets custom output template. See [table.phtml](/src/table.phtml) for implementation details and data structure. (optional)
1617
```
1718
services:
18-
errorFormatter.fileoutput: # Can be any name after errorFormatter
19-
class: noximo\FileOutput(./example/phpstan.html, null)
19+
noximo\EasyCodingStandardFileoutput\FileOutputFormatter:
20+
autowire: true
21+
arguments:
22+
$outputFile: './log/test.html'
23+
$defaultFormatter: '@Symplify\EasyCodingStandard\Console\Output\TableOutputFormatter'
24+
$customTemplate: './tests/alternative_table.phtml'
2025
```
2126

22-
You can (and should) specify second parameter to use one of the other formatters as well, so console output will be unaffected:
23-
```
24-
class: noximo\FileOutput(./example/phpstan.html, @errorFormatter.raw)
25-
```
26-
At the time of writing of this readme these formatters were available by default in PHPStan:
27-
- ```errorFormatter.checkstyle```,
28-
- ```errorFormatter.json```,
29-
- ```errorFormatter.prettyJson```,
30-
- ```errorFormatter.raw```,
31-
- ```errorFormatter.table```
27+
At the time of writing of this readme these formatters were available by default in ecs:
28+
- ```@Symplify\EasyCodingStandard\Console\Output\TableOutputFormatter```,
29+
- ```@Symplify\EasyCodingStandard\Console\Output\JsonOutputFormatter```
3230

33-
_Check [PHPStan repository](https://github.com/phpstan/phpstan) for possible updates._
31+
_Check [Easy Coding Standard repository](https://github.com/Symplify/EasyCodingStandard) for possible updates._
32+
33+
## Usage
34+
35+
simply change --output-format argument to *file*:
3436

35-
Third parameter sets custom output template.
3637
```
37-
class: noximo\FileOutput(./example/phpstan.html, null, ./tests/alternative_table.phtml)
38+
vendor\bin\ecs check someDir --output-format=file
3839
```
39-
See [table.phtml](/src/table.phtml) for implementation details and data structure.
40+
4041

4142
## Output
42-
FileOutputer will generate HTML file (assuming default template) with hyperlinks directly into PHP files where errors were encountered. If you want to leverage clickable links, set up your enviromenent according to this article: [https://tracy.nette.org/en/open-files-in-ide](https://tracy.nette.org/en/open-files-in-ide)
43+
FileOutput will generate HTML file (assuming default template) with hyperlinks directly into PHP files where errors were encountered. If you want to leverage clickable links, set up your enviromenent according to this article: [https://tracy.nette.org/en/open-files-in-ide](https://tracy.nette.org/en/open-files-in-ide)
4344

44-
Note: When you fix an error, file structure and line numbers can no longer correspond to line number at the time of analysis. You'll need to re-run PHPStan to regenerate output file. Errors are outputed in descending order (line-number wise) so there's bigger chance that you won't lines out of their current positions.
45+
Note: When you fix an error, file structure and line numbers can no longer correspond to line number at the time of analysis. You'll need to re-run ecs to regenerate output file. Errors are outputed in descending order (line-number wise) so there's bigger chance that you won't lines out of their current positions.

‎composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "noximo/ecs-fileoutput",
2+
"name": "noximo/easycodingstandard-fileoutput",
33
"description": "An error formatter for Easy Coding Standard that exports analysis result into HTML file",
44
"keywords": [
55
"Easy Coding Standard",

0 commit comments

Comments
 (0)
Please sign in to comment.