4

Is there any option to store the output of the phpcs fixer results into a file ?

I tried the below

phpcs --standard='Symfony' -a 'path' --report-file='~/Users/uname/Desktop/PHPcs'

But it gives an error:

ERROR: The specified report file path "~/Users/uname/Desktop/PHPcs" points to a non-existent directory

Run "phpcs --help" for usage information

localheinz
  • 9,179
  • 2
  • 33
  • 44
Jignesh Rawal
  • 521
  • 6
  • 17

2 Answers2

3

Nice question! As Tomáš Votruba said using > can do the trick for you.

Example of the command

phpcs [your command] > log.txt

The file will get created in the directory you are while running the command.

Naser Nikzad
  • 713
  • 12
  • 27
2

Ok got the issue sorted.

When you do the below

phpcs --standard='Symfony' -a app/path --report="~\Users\uname\Desktop\PHPcs\PHPGOG.txt"

You dont have to create your own folder

PHPCS fixer will generate the report in the same path [at the place of your code ] for which you are running the phpcs fixer.

Jignesh Rawal
  • 521
  • 6
  • 17