From: ("")
Date:  19 May 2015 16:32:37 Hong Kong Time

[PEAR-BUG] Bug #20551 [Com]: parameter --tab-width is not working

NNTP-Posting-Host:  null

Edit report at

 ID:               20551
 Comment by:
 Reported By:      jindrich dot kubat at mall dot cz
 Summary:          parameter --tab-width is not working
 Status:           Feedback
 Type:             Bug
 Package:          PHP_CodeSniffer
 Operating System: CentOS
 Package Version:  2.3.2
 PHP Version:      5.5.13
 Assigned To:      squiz
 Roadmap Versions: 
 New Comment:

Hi Greg,

yes your ruleset is working fine. Thank you for it. Maybe it would be
fine to write this link to the documentation in section --tab-width

Thank you again


Previous Comments:

[2015-05-19 01:08:53] squiz

-Status:      Open
+Status:      Feedback
-Assigned To:
+Assigned To: squiz
The PSR2 standard enforces the use of spaces for indentation even if you
try and trick it by replacing 
spaces with tabs. The indentation sniffs look at the content before tabs
are replaced.

If you want PSR2 with tabs instead of spaces, you'll need to use a
custom ruleset.xml file. I made one 

Does this work for you?


[2015-05-18 09:54:17] jkubat

Parameter --tab-width=4 with --standart=PSR2 is not working. 
Simulation to test script:

phpcs --tab-width=4 --standard=PSR2 foo.php

Test script:
namespace foo;

class Foo

	private $foo;

	public function __construct($foo)
		$this->foo = $foo;

	private function bar()

Expected result:
No Errors: Spaces must be used to indent lines; tabs are not
    |       |     allowed

Actual result:
7 Errors: Spaces must be used to indent lines; tabs are not
    |       |     allowed


Edit this bug report at