{"action":"created","issue":{"url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1380","repository_url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards","labels_url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1380/labels{/name}","comments_url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1380/comments","events_url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1380/events","html_url":"https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1380","id":333615363,"node_id":"MDU6SXNzdWUzMzM2MTUzNjM=","number":1380,"title":"Add a variable tab width in the ArrayIndentationSniff?","user":{"login":"dingo-d","id":8638515,"node_id":"MDQ6VXNlcjg2Mzg1MTU=","avatar_url":"https://avatars3.githubusercontent.com/u/8638515?v=4","gravatar_id":"","url":"https://api.github.com/users/dingo-d","html_url":"https://github.com/dingo-d","followers_url":"https://api.github.com/users/dingo-d/followers","following_url":"https://api.github.com/users/dingo-d/following{/other_user}","gists_url":"https://api.github.com/users/dingo-d/gists{/gist_id}","starred_url":"https://api.github.com/users/dingo-d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dingo-d/subscriptions","organizations_url":"https://api.github.com/users/dingo-d/orgs","repos_url":"https://api.github.com/users/dingo-d/repos","events_url":"https://api.github.com/users/dingo-d/events{/privacy}","received_events_url":"https://api.github.com/users/dingo-d/received_events","type":"User","site_admin":false},"labels":[{"id":60478597,"node_id":"MDU6TGFiZWw2MDQ3ODU5Nw==","url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/labels/Status:%20Investigation","name":"Status: Investigation","color":"5319e7","default":false},{"id":197939651,"node_id":"MDU6TGFiZWwxOTc5Mzk2NTE=","url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/labels/Type:%20Bug","name":"Type: Bug","color":"fc2929","default":false}],"state":"open","locked":false,"assignee":{"login":"jrfnl","id":663378,"node_id":"MDQ6VXNlcjY2MzM3OA==","avatar_url":"https://avatars1.githubusercontent.com/u/663378?v=4","gravatar_id":"","url":"https://api.github.com/users/jrfnl","html_url":"https://github.com/jrfnl","followers_url":"https://api.github.com/users/jrfnl/followers","following_url":"https://api.github.com/users/jrfnl/following{/other_user}","gists_url":"https://api.github.com/users/jrfnl/gists{/gist_id}","starred_url":"https://api.github.com/users/jrfnl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrfnl/subscriptions","organizations_url":"https://api.github.com/users/jrfnl/orgs","repos_url":"https://api.github.com/users/jrfnl/repos","events_url":"https://api.github.com/users/jrfnl/events{/privacy}","received_events_url":"https://api.github.com/users/jrfnl/received_events","type":"User","site_admin":false},"assignees":[{"login":"jrfnl","id":663378,"node_id":"MDQ6VXNlcjY2MzM3OA==","avatar_url":"https://avatars1.githubusercontent.com/u/663378?v=4","gravatar_id":"","url":"https://api.github.com/users/jrfnl","html_url":"https://github.com/jrfnl","followers_url":"https://api.github.com/users/jrfnl/followers","following_url":"https://api.github.com/users/jrfnl/following{/other_user}","gists_url":"https://api.github.com/users/jrfnl/gists{/gist_id}","starred_url":"https://api.github.com/users/jrfnl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrfnl/subscriptions","organizations_url":"https://api.github.com/users/jrfnl/orgs","repos_url":"https://api.github.com/users/jrfnl/repos","events_url":"https://api.github.com/users/jrfnl/events{/privacy}","received_events_url":"https://api.github.com/users/jrfnl/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2018-06-19T10:40:20Z","updated_at":"2018-06-20T13:51:59Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"From what I've looked at this sniff, the `private $tab_width` is `The --tab-width CLI value that is being used.`\r\n\r\nI tried changing the default tab width in my ruleset to 2 instead of 4, and that fails (being a private property)\r\n\r\n```xml\r\n<rule ref=\"WordPress.Arrays.ArrayIndentation\">\r\n  <properties>\r\n    <property name=\"tabIndent\" value=\"false\"/>\r\n    <property name=\"tab_width\" value=\"2\"/> // This will fail.\r\n  </properties>\r\n</rule>\r\n````\r\n\r\nI also have `<arg name=\"tab-width\" value=\"2\"/>` in my ruleset, but seems like this doesn't work for me, since I always have to indent the array key-value pairs by 4 instead of 2\r\n\r\n```php\r\n// This won't throw an error.\r\narray(\r\n    'bla' => 'blaaaa',\r\n);\r\n\r\n// This will throw an error.\r\narray(\r\n  'bla' => 'blaaaa',\r\n);\r\n```\r\n\r\nI'm not sure if setting this property to `public` will break something down the road, but I manually changed it and the above rule works.\r\n\r\nI can submit a PR if needed."},"comment":{"url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/comments/398757071","html_url":"https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1380#issuecomment-398757071","issue_url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1380","id":398757071,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODc1NzA3MQ==","user":{"login":"GaryJones","id":88371,"node_id":"MDQ6VXNlcjg4Mzcx","avatar_url":"https://avatars2.githubusercontent.com/u/88371?v=4","gravatar_id":"","url":"https://api.github.com/users/GaryJones","html_url":"https://github.com/GaryJones","followers_url":"https://api.github.com/users/GaryJones/followers","following_url":"https://api.github.com/users/GaryJones/following{/other_user}","gists_url":"https://api.github.com/users/GaryJones/gists{/gist_id}","starred_url":"https://api.github.com/users/GaryJones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GaryJones/subscriptions","organizations_url":"https://api.github.com/users/GaryJones/orgs","repos_url":"https://api.github.com/users/GaryJones/repos","events_url":"https://api.github.com/users/GaryJones/events{/privacy}","received_events_url":"https://api.github.com/users/GaryJones/received_events","type":"User","site_admin":false},"created_at":"2018-06-20T13:51:59Z","updated_at":"2018-06-20T13:51:59Z","author_association":"MEMBER","body":"Noting here that `$tab_width` property is also `private` in `PrecisionAlignmentSniff` and `DisallowInlineTabsSniff`. I can replicate the issue.\r\n\r\n"}}
{"actor":{"display_login":"GaryJones"}}