{"id":22425398,"url":"https://github.com/projektmotor/symfony-coding-standard","last_synced_at":"2025-08-01T08:32:58.564Z","repository":{"id":62530881,"uuid":"172683993","full_name":"projektmotor/symfony-coding-standard","owner":"projektmotor","description":"Symfony coding standards for ProjektMOTOR enriched by several useful rules","archived":false,"fork":false,"pushed_at":"2023-08-31T13:21:33.000Z","size":32,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-22T17:31:53.106Z","etag":null,"topics":["code-sniffer","coding-standard","phpcbf","phpcs","symfony"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/projektmotor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-26T09:52:07.000Z","updated_at":"2023-02-02T10:00:03.000Z","dependencies_parsed_at":"2023-01-28T21:30:30.123Z","dependency_job_id":null,"html_url":"https://github.com/projektmotor/symfony-coding-standard","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projektmotor%2Fsymfony-coding-standard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projektmotor%2Fsymfony-coding-standard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projektmotor%2Fsymfony-coding-standard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projektmotor%2Fsymfony-coding-standard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/projektmotor","download_url":"https://codeload.github.com/projektmotor/symfony-coding-standard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228356390,"owners_count":17907191,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-sniffer","coding-standard","phpcbf","phpcs","symfony"],"created_at":"2024-12-05T19:14:03.908Z","updated_at":"2024-12-05T19:14:04.614Z","avatar_url":"https://github.com/projektmotor.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Symfony coding standard of ProjektMOTOR\nSymfony coding standards for ProjektMOTOR enriched by several useful rules.\n\nWe at ProjektMOTOR :heart: clean code. So we have a have an internal PHP coding standard based on\nsymfony coding standard \nused for all our projects. We are using [PHP CodeSniffer][1] with the great [Symfony PHP CodeSniffer Coding Standard\n of djoos][2] and some sniffs of [Slevomat Coding Standard][3], both adopted to our own needs.\n\n## Goals of our coding standard\n\n* Using already existing standards (PSR-1, PSR-2, Symfony).\n* Coding standard can be used across different projects.\n* Avoid duplications (also between code, CVS history and documentation).\n* Ensure code quality across different dev setups (e.g. different IDEs).\n\n## Installation\n\nIf you use [Composer][4], you can install ProjektMOTOR Coding Standard in your project with the following\ncommand:\n\n```BASH\ncomposer require --dev projektmotor/symfony-coding-standard\n```\n\nOptional: To install coding standard automatically edit your composer script:\n\n```JSON\n    scripts: {\n        \"post-install-cmd\": [\n            \"@auto-scripts\"\n        ],\n        \"post-update-cmd\": [\n            \"@auto-scripts\"\n        ],\n        \"auto-scripts\": {\n            \"phpcs --config-set installed_paths vendor/projektmotor/symfony-coding-standard/ProjektMOTORCodingStandard/\": \"script\",\n        }\n    }\n```\n\n## Usage\n\nJust create a `phpcs.xml.dist` in your project's root directory with the following content:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cruleset name=\"projektmotor-coding-standard\"\u003e\n    \u003crule ref=\"vendor/projektmotor/symfony-coding-standard/ProjektMOTORCodingStandard/ruleset.xml\"\u003e\n        \u003c!-- If the standard is too hard, you can exclude some rules like this: --\u003e\n        \u003c!-- \u003cexclude name=\"Generic.Arrays.DisallowLongArraySyntax.Found\" /\u003e --\u003e\n        \u003c!-- \u003cexclude name=\"Generic.Files.LineLength.TooLong\" /\u003e --\u003e\n    \u003c/rule\u003e\n    \n    \u003c!-- Exclude project specific files if you want --\u003e\n    \u003c!-- \u003cexclude-pattern\u003eWakkaFormatter\u003c/exclude-pattern\u003e --\u003e\n\u003c/ruleset\u003e\n```\n\nAnd then you can execute the CodeSniffer like this:\n\n    vendor/bin/phpcs -s -p --colors src/\n\n\n---\n[1]: https://github.com/squizlabs/PHP_CodeSniffer#readme\n[2]: https://github.com/djoos/Symfony-coding-standard\n[3]: https://github.com/slevomat/coding-standard\n[4]: https://getcomposer.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojektmotor%2Fsymfony-coding-standard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprojektmotor%2Fsymfony-coding-standard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojektmotor%2Fsymfony-coding-standard/lists"}