{"action":"created","issue":{"url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/751","labels_url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/751/labels{/name}","comments_url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/751/comments","events_url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/751/events","html_url":"https://github.com/squizlabs/PHP_CodeSniffer/issues/751","id":113634962,"number":751,"title":"Bad indentation sniff on multiple array arguments","user":{"login":"Soullivaneuh","id":1698357,"avatar_url":"https://avatars.githubusercontent.com/u/1698357?v=3","gravatar_id":"","url":"https://api.github.com/users/Soullivaneuh","html_url":"https://github.com/Soullivaneuh","followers_url":"https://api.github.com/users/Soullivaneuh/followers","following_url":"https://api.github.com/users/Soullivaneuh/following{/other_user}","gists_url":"https://api.github.com/users/Soullivaneuh/gists{/gist_id}","starred_url":"https://api.github.com/users/Soullivaneuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Soullivaneuh/subscriptions","organizations_url":"https://api.github.com/users/Soullivaneuh/orgs","repos_url":"https://api.github.com/users/Soullivaneuh/repos","events_url":"https://api.github.com/users/Soullivaneuh/events{/privacy}","received_events_url":"https://api.github.com/users/Soullivaneuh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/labels/Awaiting%20Feedback","name":"Awaiting Feedback","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-27T17:15:05Z","updated_at":"2015-10-28T08:51:11Z","closed_at":null,"body":"With this code:\r\n\r\n```php\r\n        $formMapper\r\n            ->with('General')\r\n                ->add('name')\r\n                ->add('values', 'sonata_type_collection', [\r\n                    'by_reference'      => false,\r\n                    'mapped'            => true,\r\n                ], [\r\n                    'edit'              => 'inline',\r\n                    'inline'            => 'table',\r\n                    'link_parameters'   => ['context' => $context],\r\n                ])\r\n            ->end()\r\n        ;\r\n```\r\n\r\nCS found an error on line with `], [`:\r\n\r\n```\r\nMulti-line function call not indented correctly; expected 20 spaces but found 16\r\n```\r\n\r\nBut I think this is wrong.\r\n\r\nThe only way to make phpcs happy is to make this following \"correction\":\r\n\r\n```php\r\n        $formMapper\r\n            ->with('General')\r\n                ->add('name')\r\n                ->add('values', 'sonata_type_collection', [\r\n                    'by_reference'      => false,\r\n                    'mapped'            => true,\r\n                    ], [\r\n                    'edit'              => 'inline',\r\n                    'inline'            => 'table',\r\n                    'link_parameters'   => ['context' => $context],\r\n                    ])\r\n            ->end()\r\n        ;\r\n```\r\n\r\nBut that makes no sense IMO."},"comment":{"url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/comments/151768914","html_url":"https://github.com/squizlabs/PHP_CodeSniffer/issues/751#issuecomment-151768914","issue_url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/751","id":151768914,"user":{"login":"Soullivaneuh","id":1698357,"avatar_url":"https://avatars.githubusercontent.com/u/1698357?v=3","gravatar_id":"","url":"https://api.github.com/users/Soullivaneuh","html_url":"https://github.com/Soullivaneuh","followers_url":"https://api.github.com/users/Soullivaneuh/followers","following_url":"https://api.github.com/users/Soullivaneuh/following{/other_user}","gists_url":"https://api.github.com/users/Soullivaneuh/gists{/gist_id}","starred_url":"https://api.github.com/users/Soullivaneuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Soullivaneuh/subscriptions","organizations_url":"https://api.github.com/users/Soullivaneuh/orgs","repos_url":"https://api.github.com/users/Soullivaneuh/repos","events_url":"https://api.github.com/users/Soullivaneuh/events{/privacy}","received_events_url":"https://api.github.com/users/Soullivaneuh/received_events","type":"User","site_admin":false},"created_at":"2015-10-28T08:51:11Z","updated_at":"2015-10-28T08:51:11Z","body":"Thanks for responding.\r\n\r\nI don't want to write multi-line call. My code it's an inline call, but with multi-line arrays.\r\n\r\nFor me, this is two different part.\r\n\r\nI think this is not correct because my second past is the code corrected by phpcbf. I think you'll agree that it's not correct.\r\n\r\nBTW, if I have a call with only one array like this:\r\n\r\n```php\r\n->add('webServer', 'choice', [\r\n    'choices'   => [\r\n        'Apache'    => 'apache',\r\n        'Nginx'     => 'nginx',\r\n    ],\r\n    'choices_as_values' => true,\r\n])\r\n```\r\n\r\nIt works, no warnings or bad correction."}}