{"action":"created","issue":{"url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/724","labels_url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/724/labels{/name}","comments_url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/724/comments","events_url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/724/events","html_url":"https://github.com/squizlabs/PHP_CodeSniffer/issues/724","id":108949664,"number":724,"title":"Fatal error using PSR2 standard","user":{"login":"jimigrunge","id":3765505,"avatar_url":"https://avatars.githubusercontent.com/u/3765505?v=3","gravatar_id":"","url":"https://api.github.com/users/jimigrunge","html_url":"https://github.com/jimigrunge","followers_url":"https://api.github.com/users/jimigrunge/followers","following_url":"https://api.github.com/users/jimigrunge/following{/other_user}","gists_url":"https://api.github.com/users/jimigrunge/gists{/gist_id}","starred_url":"https://api.github.com/users/jimigrunge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimigrunge/subscriptions","organizations_url":"https://api.github.com/users/jimigrunge/orgs","repos_url":"https://api.github.com/users/jimigrunge/repos","events_url":"https://api.github.com/users/jimigrunge/events{/privacy}","received_events_url":"https://api.github.com/users/jimigrunge/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-29T20:08:36Z","updated_at":"2015-09-30T07:10:24Z","closed_at":null,"body":"When I run phpcs on a file using PSR2 standard I get a fatal error displayed in the console.\r\n\r\nError and Trace:\r\n\r\n```\r\nFatal error: Cannot redeclare class PSR2_Sniffs_Methods_FunctionCallSignatureSniff in /vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php on line 89\r\n\r\nCall Stack:\r\n    0.0002     226904   1. {main}() /vendor/squizlabs/php_codesniffer/scripts/phpcs:0\r\n    0.0/Users/jgrundner/Repositories/jcg-recipe/vendor/squizlabs/php_codesniffer/scripts/phpcs:25\r\n    0.0065    1608760   3. PHP_CodeSniffer_CLI->process() /vendor/squizlabs/php_codesniffer/CodeSniffer/CLI.php:95\r\n    0.0068    1618856   4. PHP_CodeSniffer->initStandard() /vendor/squizlabs/php_codesniffer/CodeSniffer/CLI.php:818\r\n    0.0108    1646304   5. PHP_CodeSniffer->registerSniffs() /vendor/squizlabs/php_codesniffer/CodeSniffer.php:560\r\n\r\n```\r\n\r\nSetup: \r\n\r\nInstalled on a Silex2 application via composer. Phpcs version 2.3.4 pulled from repository. Here are the relevant sections of my composer.json file.\r\n\r\n``` \r\n\"require\": {\r\n    \"silex/silex\":            \"~2.0@dev\",\r\n    \"silex/web-profiler\":     \"~2.0@dev\",\r\n    \"symfony/var-dumper\":     \"^2.7\",\r\n    \"symfony/browser-kit\":    \"~2.7\",\r\n    \"symfony/class-loader\":   \"~2.7\",\r\n    \"symfony/config\":         \"~2.7\",\r\n    \"symfony/console\":        \"~2.7\",\r\n    \"symfony/css-selector\":   \"~2.7\",\r\n    \"symfony/finder\":         \"~2.7\",\r\n    \"symfony/form\":           \"~2.7\",\r\n    \"symfony/monolog-bridge\": \"~2.7\",\r\n    \"symfony/process\":        \"~2.7\",\r\n    \"symfony/security\":       \"~2.7\",\r\n    \"symfony/translation\":    \"~2.7\",\r\n    \"symfony/twig-bridge\":    \"~2.7\",\r\n    \"symfony/validator\":      \"~2.7\",\r\n    \"twig/twig\":              \"~1.21\",\r\n    \"doctrine/dbal\":          \"~2.5\",\r\n    \"doctrine/annotations\":   \"~1.0\",\r\n    \"doctrine/cache\":         \"~1.0\",\r\n    \"knplabs/console-service-provider\": \"~1.0\",\r\n    \"twbs/bootstrap\":         \"^3.3\",\r\n    \"saxulum/config-service-provider\": \"dev-master\"\r\n  },\r\n  \"require-dev\": {\r\n    \"symfony/debug\":      \"~2.7\",\r\n    \"phpspec/phpspec\":    \"~2.2\",\r\n    \"phpunit/phpunit\":    \"^4.8\",\r\n    \"mockery/mockery\":    \"^0.9.4\",\r\n    \"whatthejeff/nyancat-phpunit-resultprinter\": \"^1.2\",\r\n    \"squizlabs/php_codesniffer\": \"2.*\",\r\n    \"sebastian/phpcpd\": \"*\"\r\n  },\r\n  \"config\": {\r\n    \"bin-dir\": \"bin\"\r\n  },\r\n  \"autoload\": {\r\n    \"psr-4\": { \"\": \"src/\" }\r\n  },\r\n```\r\n\r\nAfter doing the 'composer update' I ran phpcs on a file with the default PEAR standard and got the expected results. I then switched to PSR2 statndard like so...\r\n\r\n``` bin/phpcs --config-set default_standard psr2  ```\r\n\r\nAt this point running phpcs on the same file throws the error. Switching back to PEAR, or even PSR1, and the everything runs fine.\r\n\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/comments/144310531","html_url":"https://github.com/squizlabs/PHP_CodeSniffer/issues/724#issuecomment-144310531","issue_url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/724","id":144310531,"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-09-30T07:10:24Z","updated_at":"2015-09-30T07:10:24Z","body":"Maybe you have PHP_CodeSniffer files included twice (e.g. via global Composer install and via project dependencies)?"}}