@@ -41,28 +41,53 @@ To automatically fix as many sniff violations as possible, use the `phpcbf` comm
4141
4242When using the PHPCBF command, you do not need to specify a report type. PHPCBF will automatically make changes to your source files:
4343
44+ <!--
45+ Regenerate the below output snippet by running the following command from the PHP_CodeSniffer project root directory:
46+ $ phpcbf ./src/Runner.php ./src/Config.php --standard=PSR12 --basepath=./ --report-width=100
47+ WARNING: DO NOT COMMIT THE RESULT!
48+ -->
4449``` bash
4550$ phpcbf /path/to/code
46- Processing init.php [PHP => 7875 tokens in 960 lines]... DONE in 274ms (12 fixable violations)
47- => Fixing file: 0/12 violations remaining [made 3 passes]... DONE in 412ms
48- Processing config.php [PHP => 8009 tokens in 957 lines]... DONE in 421ms (155 fixable violations)
49- => Fixing file: 0/155 violations remaining [made 7 passes]... DONE in 937ms
50- Patched 2 files
51- Time: 2.55 secs, Memory: 25.00Mb
51+
52+ PHPCBF RESULT SUMMARY
53+ ----------------------------------------------------------------------
54+ FILE FIXED REMAINING
55+ ----------------------------------------------------------------------
56+ src/Runner.php 95 16
57+ src/Config.php 889 38
58+ ----------------------------------------------------------------------
59+ A TOTAL OF 984 ERRORS WERE FIXED IN 2 FILES
60+ ----------------------------------------------------------------------
5261```
5362
5463If you do not want to overwrite existing files, you can specify the ` --suffix ` command line argument and provide a filename suffix to use for new files. A fixed copy of each file will be created and stored in the same directory as the original file. If a file already exists with the new name, it will be overwritten.
5564
65+ <!--
66+ Regenerate the below output snippet by running the following command from the PHP_CodeSniffer project root directory:
67+ $ phpcbf -v ./src/Runner.php ./src/Config.php --standard=PSR12 --suffix=.fixed --basepath=./ --report-width=100
68+ WARNING: DO NOT COMMIT THE RESULT!
69+ -->
5670``` bash
57- $ phpcbf /path/to/code --suffix=.fixed
58- Processing init.php [PHP => 7875 tokens in 960 lines]... DONE in 274ms (12 fixable violations)
59- => Fixing file: 0/12 violations remaining [made 3 passes]... DONE in 412ms
60- => Fixed file written to init.php.fixed
61- Processing config.php [PHP => 8009 tokens in 957 lines]... DONE in 421ms (155 fixable violations)
62- => Fixing file: 0/155 violations remaining [made 7 passes]... DONE in 937ms
63- => Fixed file written to config.php.fixed
64- Fixed 2 files
65- Time: 2.55 secs, Memory: 25.00Mb
71+ $ phpcbf -v /path/to/code --suffix=.fixed
72+
73+ Creating file list... DONE (2 files in queue)
74+ Changing into directory src
75+ Processing Runner.php [6415 tokens in 907 lines]... DONE in 193ms (91 fixable errors, 4 fixable warnings)
76+ => Fixing file: 0/95 violations remaining [made 4 passes]... DONE in 771ms
77+ => Fixed file written to Runner.php.fixed
78+ Processing Config.php [13891 tokens in 1792 lines]... DONE in 444ms (865 fixable errors, 24 fixable warnings)
79+ => Fixing file: 0/889 violations remaining [made 4 passes]... DONE in 1.72 secs
80+ => Fixed file written to Config.php.fixed
81+
82+ PHPCBF RESULT SUMMARY
83+ ----------------------------------------------------------------------
84+ FILE FIXED REMAINING
85+ ----------------------------------------------------------------------
86+ src/Runner.php 95 16
87+ src/Config.php 889 38
88+ ----------------------------------------------------------------------
89+ A TOTAL OF 984 ERRORS WERE FIXED IN 2 FILES
90+ ----------------------------------------------------------------------
6691```
6792
6893<p align =" right " ><a href =" #table-of-contents " >back to top</a ></p >
0 commit comments