{"action":"created","issue":{"url":"https://api.github.com/repos/concrete5/concrete5/issues/5971","repository_url":"https://api.github.com/repos/concrete5/concrete5","labels_url":"https://api.github.com/repos/concrete5/concrete5/issues/5971/labels{/name}","comments_url":"https://api.github.com/repos/concrete5/concrete5/issues/5971/comments","events_url":"https://api.github.com/repos/concrete5/concrete5/issues/5971/events","html_url":"https://github.com/concrete5/concrete5/pull/5971","id":258797827,"node_id":"MDExOlB1bGxSZXF1ZXN0MTQxODMxNzk5","number":5971,"title":"Coding style with php cs fixer","user":{"login":"mlocati","id":928116,"node_id":"MDQ6VXNlcjkyODExNg==","avatar_url":"https://avatars3.githubusercontent.com/u/928116?v=4","gravatar_id":"","url":"https://api.github.com/users/mlocati","html_url":"https://github.com/mlocati","followers_url":"https://api.github.com/users/mlocati/followers","following_url":"https://api.github.com/users/mlocati/following{/other_user}","gists_url":"https://api.github.com/users/mlocati/gists{/gist_id}","starred_url":"https://api.github.com/users/mlocati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlocati/subscriptions","organizations_url":"https://api.github.com/users/mlocati/orgs","repos_url":"https://api.github.com/users/mlocati/repos","events_url":"https://api.github.com/users/mlocati/events{/privacy}","received_events_url":"https://api.github.com/users/mlocati/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-09-19T12:11:22Z","updated_at":"2018-11-27T16:33:22Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/concrete5/concrete5/pulls/5971","html_url":"https://github.com/concrete5/concrete5/pull/5971","diff_url":"https://github.com/concrete5/concrete5/pull/5971.diff","patch_url":"https://github.com/concrete5/concrete5/pull/5971.patch"},"body":"This pull request defines a common set of rules, to be executed both by TravisCI (to check the coding style) and by developers (to automatically fix the coding style).\r\n\r\nThis pull request implements a quite intelligent approach, that takes in account these cases:\r\n1. we have some file that needs to be compatible with old PHP versions (notably `/index.php`, `/concrete/dispatcher.php` and `/concrete/bin/concrete5.php`)', where we can't use the PHP 5.5+ syntax (short array syntax, short echo tags, ...).\r\n2. we have files with mixed PHP and HTML, where the indentation and the position of opening/closing PHP tags shouldn't be touched\r\n3. we have files whose file names should be the same as the class names they implements (PSR-4).\r\n4. we have PHP-only files implementing classes that don't follow the PSR-4 rules (for instance, block controllers)\r\n\r\nThis pull request applies the correct fixes for the files, determining the relevant rule set by checking their paths.\r\n\r\nSince concrete5 doesn't currently follow all the rules defined in the included `CodingStyle.php` file, the coding style checks of TravisCI should fail. In order to fix this, we could run these commands to fix all the above file classes:\r\n1. `composer fix --config=.php_cs.bootstrap`\r\n2. `composer fix --config=.php_cs.mixed`\r\n3. `composer fix --config=.php_cs.psr4`\r\n4. `composer fix --config=.php_cs.phponly`\r\n\r\nWhen developers write a file, they don't have to specify the correct configuration file (`.php_cs.bootstrap`, `.php_cs.mixed`, `.php_cs.psr4` or `.php_cs.phponly`): by using the `.php_cs.dist` configuration file (eg `composer php-cs-fixer fix --config=.php_cs.dist <filename>`), the correct rule set is used.\r\n\r\nOf course, the list of rules defined here is just a proposal: others interested in this subject can comment here (or create pull requests against https://github.com/mlocati/concrete5/tree/coding-style-with-php-cs-fixer ).\r\n\r\nClose #3539"},"comment":{"url":"https://api.github.com/repos/concrete5/concrete5/issues/comments/442125289","html_url":"https://github.com/concrete5/concrete5/pull/5971#issuecomment-442125289","issue_url":"https://api.github.com/repos/concrete5/concrete5/issues/5971","id":442125289,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjEyNTI4OQ==","user":{"login":"mlocati","id":928116,"node_id":"MDQ6VXNlcjkyODExNg==","avatar_url":"https://avatars3.githubusercontent.com/u/928116?v=4","gravatar_id":"","url":"https://api.github.com/users/mlocati","html_url":"https://github.com/mlocati","followers_url":"https://api.github.com/users/mlocati/followers","following_url":"https://api.github.com/users/mlocati/following{/other_user}","gists_url":"https://api.github.com/users/mlocati/gists{/gist_id}","starred_url":"https://api.github.com/users/mlocati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlocati/subscriptions","organizations_url":"https://api.github.com/users/mlocati/orgs","repos_url":"https://api.github.com/users/mlocati/repos","events_url":"https://api.github.com/users/mlocati/events{/privacy}","received_events_url":"https://api.github.com/users/mlocati/received_events","type":"User","site_admin":false},"created_at":"2018-11-27T16:33:22Z","updated_at":"2018-11-27T16:33:22Z","author_association":"COLLABORATOR","body":"Superseded by #7355"}}
{"actor":{"display_login":"mlocati"}}