{"id":18248265,"url":"https://github.com/district09/php_package_qa-drupal","last_synced_at":"2025-04-04T15:32:22.686Z","repository":{"id":43792544,"uuid":"292303641","full_name":"district09/php_package_qa-drupal","owner":"district09","description":"District09 QA for PHP","archived":false,"fork":false,"pushed_at":"2024-03-04T14:17:23.000Z","size":190,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2024-04-23T10:47:59.669Z","etag":null,"topics":["d09check22","web"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"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/district09.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2020-09-02T14:18:17.000Z","updated_at":"2022-12-18T10:15:38.000Z","dependencies_parsed_at":"2024-01-14T09:17:51.601Z","dependency_job_id":"ad9acba9-836d-48d8-8a46-4d4104b66dc4","html_url":"https://github.com/district09/php_package_qa-drupal","commit_stats":{"total_commits":133,"total_committers":9,"mean_commits":"14.777777777777779","dds":0.6090225563909775,"last_synced_commit":"669e767cfec04c6215d5e425d465a61c0fd4c5ff"},"previous_names":[],"tags_count":74,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/district09%2Fphp_package_qa-drupal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/district09%2Fphp_package_qa-drupal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/district09%2Fphp_package_qa-drupal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/district09%2Fphp_package_qa-drupal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/district09","download_url":"https://codeload.github.com/district09/php_package_qa-drupal/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247203063,"owners_count":20900906,"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":["d09check22","web"],"created_at":"2024-11-05T09:36:26.153Z","updated_at":"2025-04-04T15:32:17.676Z","avatar_url":"https://github.com/district09.png","language":"PHP","funding_links":[],"categories":["Scripts"],"sub_categories":["Git hooks"],"readme":"# Quality Assurance - Drupal\n\nThis package provides a set of Quality Assurance tools and configuration files\nfor Drupal websites and extensions (modules, themes or profiles).\n\n[![Build Status Master][travis-badge]][travis-link]\n[![Maintainability][codeclimate-maint-badge]][codeclimate-maint-link]\n[![License][license-badge]][license-link]\n\n## Requirements\n\n* [Composer](https://getcomposer.org)\n\n## Versions\n\nThe versions support different PHP \u0026 Drupal versions:\n\n* Until 1.4.x : PHP 7.3 or 7.4 \u0026 Drupal 8.8+ or 9+.\n* From 1.5.x : PHP 7.4 \u0026 Drupal 9.1 or higher.\n* From 1.7.X : PHP 7.4, 8.X \u0026 DRUPAL 9.3 or higher.\n* From 3.0.x : PHP 8.3, DRUPAL 10.3 or higher.\n\n## Installation\n\nThe installation depends on the type of project: website or Drupal module.\n\n### Drupal website\n\nAdd the `grumphp` entry to the `extra` section of your `composer.json`.\n\n```json\n\"grumphp\": {\n    \"config-default-path\": \"vendor/digipolisgent/qa-drupal/configs/grumphp-site.yml\"\n}\n```\n\nAdd the qa-drupal package as dev requirement:\n\n```bash\ncomposer require --dev digipolisgent/qa-drupal:^1.5\n```\n\n### Drupal module\n\nAdd the `grumphp` entry to the `extra` section of your `composer.json`.\n\n```json\n\"grumphp\": {\n    \"config-default-path\": \"vendor/digipolisgent/qa-drupal/configs/grumphp-extension.yml\"\n}\n```\n\nAdd the qa-drupal package as dev requirement:\n\n```bash\ncomposer require --dev digipolisgent/qa-drupal:^1.5\n```\n\n## Configuration\n\n### General\n\nIf required you can extend or override the provided configuration file of a\ntask. Simply create the matching configuration file in the root of your project.\n\nFor example, to override the provided `phpcs.xml` file you can either create a\n`phpcs.xml` or `phpcs.local.xml` file.\n\nNote that the `.local.` files should only be used for changes that shouldn't be\ncommitted. Exclude them in `.gitignore`:\n\n```gitignore\n/*.local.*\n```\n\nYaml and Neon files will extend (merged into) the provided configuration file by\ndefault. Create a `.env` or `.env.local` file and add following contents to\nchange this behaviour:\n\n```\n[FILENAME]_SKIP_[TYPE]=1\n```\n\nWherein `[FILENAME]` matches the configuration filename and `[TYPE]` is either:\n\n- `LOCAL` to skip for example your `phpstan.local.neon` file.\n- `PROJECT` to skip for example your `phpstan.neon` file.\n- `PACKAGE_TYPE` to skip for example the provided `phpstan-extension.neon` or\n  `phpstan-site.neon` file.\n- `PACKAGE_GLOBAL` to skip for example the provided `phpstan.neon` file.\n\nOther file types cannot be merged and will just override all other less specific\nfiles.\n\n### PHPStan in deprecations only mode\n\nCreate a `phpstan.neon` file and add following contents to ignore everything\nexcept deprecations:\n\n```\nparameters:\n  customRulesetUsed: true\n  ignoreErrors:\n    - '#^(?:(?!deprecated).)*$#'\n```\n\n### Ignore automatically created config files\n\nSome GrumPHP tasks require a config file. These are automatically creacted, from\nthe examples within vendor/qa-drupal/config or by the project specific files\nwithin your website or drupal module root directory. The generated files are\nalso stored in the same website/module root. You can recognize these files by\nthe `.qa-drupal.` suffix.\n\n**These files should not be committed!** Add them to the `.gitignore` file:\n\n```gitignore\n/*.qa-drupal.*\n```\n\n### Ignore PHPUnit build files\n\nWhen the PHPUnit task runs, coverage report files are stored into the `build`\ndirectory located in the root of your website/project. Add this file to the\n`.gitignore` file:\n\n```gitignore\n/build\n/.phpunit.result.cache\n```\n\n### Run PHPUnit locally without coverage\n\nRunning PHPUnit with coverage report is time-consuming. You can locally speed up\nPHPUnit by copying the generated `phpunit.qa-drupal.xml` file to\n`phpunit.local.xml` and remove the `\u003clogging\u003e` section from it.\n\n## Run GrumPHP\n\nGrumPHP will automatically run all tasks on the changed code on git commit and\npush.\n\nYou can run all tasks at once:\n\n```bash\nvendor/bin/grumphp\n```\n\nOr you can run one or more specific tasks manually by running:\n\n```bash\nvendor/bin/grumphp --tasks phpcs,phpmd\nvendor/bin/grumphp --tasks phpunit\n```\n\n## PHPStorm\n\nPHPStorm requires config files for PHP_CodeSniffer, PHP Mess Detector \u0026 PhpUnit.\nRun the grumphp command at least once (successfully) to generate these files.\n\nThe files will be created as:\n\n- `phpcs.qa-drupal.xml` : PHP_CodeSniffer config file.\n- `phpmd.qa-drupal.xml` : PHP Mess Detector config file.\n- `phpunit.qa-drupal.xml` : PHPUnit config file.\n\nConfigure the paths to these files in PHPStorm:\n\n* Editor \u003e Inspections \u003e PHP \u003e Quality tools \u003e PHP Mess Detector validation\n  Add `phpmd.qa-drupal.xml` to the \"Custom rulesets\".\n* Editor \u003e Inspections \u003e PHP \u003e Quality tools \u003e PHP_CodeSniffer validation\n  Set \"Coding Standard\" to \"Custom\" and set the path to `phpcs.qa-drupal.xml`.\n* Languages \u0026 Frameworks \u003e PHP \u003e Test Frameworks \u003e Test Runner\n  Set \"Default configuration file\" to `phpunit.qa-drupal.xml`.\n\n## CodeClimate\n\nUpdate the `.codeclimate.yml` file within your project.\n\nMake sure that you use the CodeClimate specific phpcs config file:\n\n```yaml\nprepare:\n  fetch:\n    - url: \"https://raw.githubusercontent.com/digipolisgent/php_package_qa-drupal/1.x/configs/phpcs-codeclimate.xml\"\n      path: \".phpcs.xml\"\n```\n\nMake sure that you use the beta channel for the PHPCodeSniffer plugin:\n\n```yaml\nplugins:\n  phpcodesniffer:\n    enabled: true\n    channel: beta\n    config:\n      standard: \".phpcs.xml\"\n```\n\n### PHP compatibility\n\nIn order to check php compatibility you can use the phpcs `PHPCompatibility` sniff:\n\n```bash\nphp vendor/bin/phpcs -p --ignore=\"*/vendor/*\" --extensions=php,inc,module,install,theme --runtime-set testVersion 8.1 --standard=PHPCompatibility ./web/modules/contrib\n```\n\n[license-badge]: https://img.shields.io/packagist/l/digipolisgent/qa-drupal\n[license-link]: LICENSE.md\n\n[travis-badge]: https://api.travis-ci.com/district09/php_package_qa-drupal.svg?branch=develop \"Travis build develop\"\n[travis-link]: https://travis-ci.com/github/district09/php_package_qa-drupal/branches\n\n[codeclimate-maint-badge]: https://api.codeclimate.com/v1/badges/d3d6d20fbc6efb09337e/maintainability\n[codeclimate-maint-link]: https://codeclimate.com/github/district09/php_package_qa-drupal/maintainability\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdistrict09%2Fphp_package_qa-drupal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdistrict09%2Fphp_package_qa-drupal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdistrict09%2Fphp_package_qa-drupal/lists"}