{"action":"created","issue":{"url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/674","labels_url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/674/labels{/name}","comments_url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/674/comments","events_url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/674/events","html_url":"https://github.com/squizlabs/PHP_CodeSniffer/issues/674","id":99312887,"number":674,"title":"Wrong document sniff errors for pass by reference variable.","user":{"login":"ava-dylang","id":5456518,"avatar_url":"https://avatars.githubusercontent.com/u/5456518?v=3","gravatar_id":"","url":"https://api.github.com/users/ava-dylang","html_url":"https://github.com/ava-dylang","followers_url":"https://api.github.com/users/ava-dylang/followers","following_url":"https://api.github.com/users/ava-dylang/following{/other_user}","gists_url":"https://api.github.com/users/ava-dylang/gists{/gist_id}","starred_url":"https://api.github.com/users/ava-dylang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ava-dylang/subscriptions","organizations_url":"https://api.github.com/users/ava-dylang/orgs","repos_url":"https://api.github.com/users/ava-dylang/repos","events_url":"https://api.github.com/users/ava-dylang/events{/privacy}","received_events_url":"https://api.github.com/users/ava-dylang/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":3,"created_at":"2015-08-05T22:26:18Z","updated_at":"2015-08-19T17:15:48Z","closed_at":null,"body":"Within the php file there is a function that passes by reference, documented as:\r\n```\r\n    /**\r\n     * Foo that bars\r\n     *\r\n     * @param String $foo  Foo comment\r\n     * @param Array  &$bar Associative array of bar\r\n     *\r\n     * @return A barred Foo\r\n     */\r\n    protected function my_func($foo, &$bar)\r\n```\r\n\r\nPhpcs reports two errors:\r\n\r\n```\r\n----------------------------------------------------------------------\r\nFOUND 2 ERRORS AFFECTING 2 LINES\r\n----------------------------------------------------------------------\r\n 160 | ERROR | Doc comment for parameter \"$bar\" missing\r\n 164 | ERROR | Doc comment for parameter &$bar does not match\r\n     |       | actual variable name $bar\r\n———————————————————————————————————\r\n```\r\n\r\nWith the ampersand removed from the comment block\r\n```\r\n--------------------------------------------------------------------------------\r\nFOUND 1 ERROR(S) AFFECTING 1 LINE(S)\r\n--------------------------------------------------------------------------------\r\n 164 | ERROR | Doc comment for var $bar does not match actual variable\r\n     |       | name &$bar at position 2\r\n————————————————————————————————————————\r\n```\r\n\r\n---\r\n\r\nOne of these two cases needs to work.\r\nFor the first case, shouldn't it be impossible to get both these errors in the first error set? (There errors contradict the actual file contents!)\r\nFor the second case, we can't drop pass by reference as an option.\r\n\r\nI've googled looking for any reporting of a recently introduced issue but found nothing; My best guess is that Travis's doc on setting up phpcs is undocumented-deprecated by developments in CodeSniffer.\r\n\r\n---\r\n\r\nThere errors were reported by TravisCI:\r\n - phpcs installed by TravisCi like: `pear install PHP_CodeSniffer; phpenv rehash` (`PHP_CodeSniffer-2.3.3.tgz`)\r\n - using `--standards=` file:\r\n\r\n    ```\r\n    <?xml version=\"1.0\"?>\r\n    <ruleset name=\"Standards\">\r\n     <rule ref=\"PEAR\">\r\n      <exclude name=\"PEAR.WhiteSpace.ScopeIndent\"/>\r\n     </rule>\r\n    </ruleset>\r\n    ```\r\n\r\n---\r\n\r\nAny leads on how to fix phpcs, our ruleset, or disable warnings for pass-by-reference doc names not matching function doc names is what I need."},"comment":{"url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/comments/132699520","html_url":"https://github.com/squizlabs/PHP_CodeSniffer/issues/674#issuecomment-132699520","issue_url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/674","id":132699520,"user":{"login":"aik099","id":1277526,"avatar_url":"https://avatars.githubusercontent.com/u/1277526?v=3","gravatar_id":"","url":"https://api.github.com/users/aik099","html_url":"https://github.com/aik099","followers_url":"https://api.github.com/users/aik099/followers","following_url":"https://api.github.com/users/aik099/following{/other_user}","gists_url":"https://api.github.com/users/aik099/gists{/gist_id}","starred_url":"https://api.github.com/users/aik099/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aik099/subscriptions","organizations_url":"https://api.github.com/users/aik099/orgs","repos_url":"https://api.github.com/users/aik099/repos","events_url":"https://api.github.com/users/aik099/events{/privacy}","received_events_url":"https://api.github.com/users/aik099/received_events","type":"User","site_admin":false},"created_at":"2015-08-19T17:15:48Z","updated_at":"2015-08-19T17:15:48Z","body":"There is a release log: https://github.com/squizlabs/PHP_CodeSniffer/releases"}}