{"id":27078959,"url":"https://github.com/netlogix/coding-guidelines-php","last_synced_at":"2026-03-01T15:01:46.827Z","repository":{"id":63574002,"uuid":"538216366","full_name":"netlogix/coding-guidelines-php","owner":"netlogix","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-03T12:32:40.000Z","size":27,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-10-27T02:57:46.331Z","etag":null,"topics":["php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/netlogix.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-09-18T19:20:09.000Z","updated_at":"2022-09-18T19:24:31.000Z","dependencies_parsed_at":"2023-02-09T02:15:19.330Z","dependency_job_id":"b1d4cdaa-e7bd-4d91-bfbb-e8b0538c79fa","html_url":"https://github.com/netlogix/coding-guidelines-php","commit_stats":{"total_commits":10,"total_committers":3,"mean_commits":"3.3333333333333335","dds":"0.30000000000000004","last_synced_commit":"ac81f74a6267ce1d0c604f13b044c4a0b425a248"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/netlogix/coding-guidelines-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netlogix%2Fcoding-guidelines-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netlogix%2Fcoding-guidelines-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netlogix%2Fcoding-guidelines-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netlogix%2Fcoding-guidelines-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netlogix","download_url":"https://codeload.github.com/netlogix/coding-guidelines-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netlogix%2Fcoding-guidelines-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29973103,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T14:44:57.896Z","status":"ssl_error","status_checked_at":"2026-03-01T14:43:27.662Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["php"],"created_at":"2025-04-06T01:20:10.393Z","updated_at":"2026-03-01T15:01:46.797Z","avatar_url":"https://github.com/netlogix.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# netlogix coding guidelines for PHP\n\n## Installation\n- Install the Composer Package via:\n```bash\ncomposer require --dev netlogix/coding-guidelines-php\n```\n\n- Import the `CodeStyleSettings.xml` into your PhpStorm IDE using:\n\u003ckbd\u003eSettings/Preferences\u003c/kbd\u003e \u003e \u003ckbd\u003eEditor\u003c/kbd\u003e \u003e \u003ckbd\u003eCode Style\u003c/kbd\u003e \u003e \u003ckbd\u003ePHP\u003c/kbd\u003e \u003e \u003ckbd\u003e⚙️\u003c/kbd\u003e \u003e \u003ckbd\u003eImport Scheme...\u003c/kbd\u003e\n\n\n## Basic configuration\nOnce installed, add a `ecs.php` file next to your composer.json:\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nuse Netlogix\\CodingGuidelines\\Php\\DefaultPhp;\nuse Symplify\\EasyCodingStandard\\Config\\ECSConfig;\n\nreturn static function (ECSConfig $ecsConfig): void {\n    (new DefaultPhp())-\u003econfigure($ecsConfig);\n\n    $ecsConfig-\u003epaths(\n        [\n            __DIR__ . '/src',\n        ]\n    );\n};\n```\n\nAdd composer scripts for `lint` and `lint-fix`:\n```json\n{\n    \"name\": \"my/package\",\n    \"require-dev\": {\n        \"netlogix/coding-guidelines-php\": \"@dev\"\n    },\n    \"scripts\": {\n        \"lint\": \"ecs check\",\n        \"lint-fix\": \"ecs check --fix\"\n    }\n}\n```\n\nYou can then use `composer run lint` for linting and `composer run lint-fix` to fix issues where possible.\n\n## Configuration for Neos / Flow projects\nThere is a special ruleset for Neos or Flow projects called `DefaultFlow`. You can simply use that instead of `DefaultPhp` in your `ecs.php`:\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nuse Netlogix\\CodingGuidelines\\Php\\Neos\\Flow\\DefaultFlow;\nuse Symplify\\EasyCodingStandard\\Config\\ECSConfig;\n\nreturn static function (ECSConfig $ecsConfig): void {\n    (new DefaultFlow())-\u003econfigure($ecsConfig);\n\n    $ecsConfig-\u003epaths(\n        [\n            __DIR__ . '/DistributionPackages',\n        ]\n    );\n};\n```\n\n## Customizing linting rules\nTo adjust the linting rules for a specific project, you can use the getters provided by our rulesets in your `ecs.php`:\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nuse Netlogix\\CodingGuidelines\\Php\\DefaultPhp;\nuse Netlogix\\CodingGuidelines\\Php\\Neos\\Flow\\DefaultFlow;\nuse Symplify\\EasyCodingStandard\\Config\\ECSConfig;\n\nreturn static function (ECSConfig $ecsConfig): void {\n    (new DefaultFlow())-\u003econfigure($ecsConfig);\n\n    // Combine rules of DefaultPhp, DefaultFlow and the FinalClassFixer\n    $ecsConfig-\u003erules(\n        array_merge(\n            DefaultPhp::getRules(),\n            DefaultFlow::getRules(),\n            [\n                \\PhpCsFixer\\Fixer\\ClassNotation\\FinalClassFixer::class,\n            ]\n        )\n    );\n    \n    // Combine skips of DefaultPhp, DefaultFlow and the OrderedClassElementsFixer\n    $ecsConfig-\u003eskip(\n        array_merge(\n            DefaultPhp::getSkips(),\n            DefaultFlow::getSkips(),\n            [\n                \\PhpCsFixer\\Fixer\\ClassNotation\\OrderedClassElementsFixer::class,\n            ]\n        )\n    );\n\n    $ecsConfig-\u003epaths(\n        [\n            __DIR__ . '/src',\n        ]\n    );\n};\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetlogix%2Fcoding-guidelines-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetlogix%2Fcoding-guidelines-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetlogix%2Fcoding-guidelines-php/lists"}