{"id":22151041,"url":"https://github.com/justcoded/phpcodesniffer","last_synced_at":"2025-07-26T04:31:44.197Z","repository":{"id":89292016,"uuid":"78133450","full_name":"justcoded/phpcodesniffer","owner":"justcoded","description":"PHP Code Sniffer custom rules pack","archived":true,"fork":false,"pushed_at":"2018-09-11T12:40:10.000Z","size":1499,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T13:21:22.755Z","etag":null,"topics":["phpcodesniffer-rules","phpcodesniffer-standard"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/justcoded.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-05T17:24:56.000Z","updated_at":"2023-09-19T10:00:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"0f12e8f2-fa9b-480d-86ce-54bde716d27b","html_url":"https://github.com/justcoded/phpcodesniffer","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/justcoded/phpcodesniffer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justcoded%2Fphpcodesniffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justcoded%2Fphpcodesniffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justcoded%2Fphpcodesniffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justcoded%2Fphpcodesniffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justcoded","download_url":"https://codeload.github.com/justcoded/phpcodesniffer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justcoded%2Fphpcodesniffer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267117250,"owners_count":24038640,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["phpcodesniffer-rules","phpcodesniffer-standard"],"created_at":"2024-12-02T00:29:53.035Z","updated_at":"2025-07-26T04:31:44.185Z","avatar_url":"https://github.com/justcoded.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## PHP Code Sniffer and Mess Detector scripts / rules\n\nInstallation instructions:\n\n1. Clone repository on your drive\n2. Run `composer install`\n3. Run: `chmod +x phpcsx phpmd.phar`\n4. Configure your PhpStorm to use both scripts\n    - Close all projects to edit settings without project dependency\n    - Open Settings\n    - Open Languages \u0026 Frameworks \u003e PHP \u003e Code Sniffer\n        - Add new configuration and specify a path to `phpcsx`\n    - Open Languages \u0026 Frameworks \u003e PHP \u003e Mess Detector\n        - Add new configuration and specify a path to `phpmd.phar`\n    - Open Editor \u003e Inspections\n        - Find PHP Mess Detector and enable it.\n        - Find PHP Code Sniffer and enable it. Specify default standard as \"JustcodedWordPress\" or \"JustcodedPSR2\"\n\n## About\n\n[PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer) is a library, which can validate coding style standard and best practices to be in used.\nYou can check simple video to find out basics about PHPCS: https://www.youtube.com/watch?v=tKih3UZuwXw  \n\n[PHP Mess Detector](https://phpmd.org/) is another cool code analyzer tool. It can analyze possible bugs, suboptimal code, overcomplicated expressions, ununsed code, etc.\n\n## Usage\n\n### From PHPStorm\n\nInside PHP Storm you can configure to auto-run it directly inside your editor (default settings, when you enable an Inspection).\nOr you can run a specific inspection from a menu: Code \u003e Inspect Code. And then see all errors across some file or even folder.\n\n### CLI\n\nBy default PHPCS has a command line interface to run the same checks. For example, you can run:\n\n```bash\n./phpcsx --standard=JustcodedWordpress /var/www/wordpress/wp-content/themes/my-theme/\n``` \n\n## PHPStorm configuration\n\n### Code style import\n\nPHPStorm has it's own built-in WordPress and PSR-2 code styles presets, however they follow only must rules and it some cases are not accurate.\nWe updated code styles to work with current WordPress repository rulesets and modern framework code styles. \nYou can find code styles inside `phpstorm` directory in this repository.\n\nTo import a code style:\n\n- Open Settings\n- Navigate Editor \u003e Code Style \n- Click on wheel icon near a \"Scheme\" and choose \"Import scheme\"\n- Select xml file to import\n- Select new \"Wordpress\" or \"PSR2 tabs\" scheme\n\n### Code templates configuration\n\nWe belive that all code should be well documented and this means that all properties and methods should have a proper descriptions.\nHowever some methods are self-explanatory like getters or setters. You can configure you PHPStorm to autocomplete short method name to help you minimize you text typing for self-explanatory methods.\n\nTo configure that:  \n\n* Open Settings \u003e Editor \u003e File and Code Templates \u003e \"Includes\" tab -\u003e Php Function Doc Comment\n* Replace template with the following: \n\n```java\n#set( $name = ${NAME} )\n/**\n* $name.substring(0,1).toUpperCase()$name.substring(1).replaceAll(\"([A-Z])\", \" $1\")\n*\n${PARAM_DOC}\n#if (${TYPE_HINT} != \"void\") * @return ${TYPE_HINT}\n#end\n${THROWS_DOC}\n*/\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustcoded%2Fphpcodesniffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustcoded%2Fphpcodesniffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustcoded%2Fphpcodesniffer/lists"}