From 1e7bddf09881d619312cbd1cbd17245371e1bdb7 Mon Sep 17 00:00:00 2001 From: Daniel Speicher <daniel.speicher@lakedrops.com> Date: Fri, 31 May 2024 08:13:47 +0200 Subject: [PATCH] Document Drupal Development Env: composer/plugin/drupal-development-environment#1 --- .../plugin/drupal-dev-environment/index.md | 4 ++-- docs/dev_tools/test.md | 22 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/composer/plugin/drupal-dev-environment/index.md b/docs/composer/plugin/drupal-dev-environment/index.md index a0ac6a2..a9bfba3 100644 --- a/docs/composer/plugin/drupal-dev-environment/index.md +++ b/docs/composer/plugin/drupal-dev-environment/index.md @@ -15,10 +15,10 @@ It provides a massive amount of testing tools, which can be executed out of the - [Dependency Analysis](../../../dev_tools/test.md#drupal-dependency-analysis) - [PHP Unit](../../../dev_tools/test.md#unitkernelfunctional-testing) - [PHP Code Sniffer](../../../dev_tools/test.md#php-code-sniffer) -- [PHP Stan](../../../dev_tools/test.md#php-stan) +- [PHPStan](../../../dev_tools/test.md#phpstan) - [PHP Lint](../../../dev_tools/test.md#php-lint) - [PHP LOC](../../../dev_tools/test.md#php-loc) -- [PHP Mess Detection](../../../dev_tools/test.md#php-mess-detection) +- [PHP Mess Detector](../../../dev_tools/test.md#php-mess-detector) - [PHP Metrics](../../../dev_tools/test.md#php-metrics) - [Stylelint](../../../dev_tools/test.md#stylelint) - [Eslint](../../../dev_tools/test.md#es-lint) diff --git a/docs/dev_tools/test.md b/docs/dev_tools/test.md index c5b4ec2..64be514 100644 --- a/docs/dev_tools/test.md +++ b/docs/dev_tools/test.md @@ -43,10 +43,10 @@ drupal/blazy 2.16.0 2.27.0 Provides.. We have several tools to perform static code analysis. - [PHP Code Sniffer](#php-code-sniffer) -- [PHP PHPStan](#php-stan) +- [PHPStan](#phpstan) - [PHP Lint](#php-lint) - [PHP LOC](#php-loc) -- [PHP Mess Detection](#php-mess-detection) +- [PHP Mess Detector](#php-mess-detector) - [PHP Metrics](#php-metrics) - [Stylelint](#stylelint) - [Eslint](#es-lint) @@ -54,7 +54,7 @@ We have several tools to perform static code analysis. ### PHP Code Sniffer PHP Code Sniffer performs a static code analysis with a specific Drupal profile. It detects -code smells like static calls. +code smells like static calls. See [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer). You can execute PHP CS for a specific Drupal contrib module: @@ -99,10 +99,10 @@ a test phpcs-fix <contrib_module> Now th errors are gone, which saves a lot of time and effort. -### PHP Stan +### PHPStan We use level 6 as default, which is pretty good and strict and provides a very clean code. You can adjust this in the -`phpstan.neon` file. It looks like this: +`phpstan.neon` file. See [PHPStan](https://phpstan.org/). It looks like this: ```phpstan parameters: @@ -135,7 +135,7 @@ recursively. ### PHP Lint -You can execute PHP Lint for a specific Drupal contrib module: +You can execute [PHP Lint](https://github.com/overtrue/phplint) for a specific Drupal contrib module: ```phplint a test phplintmodule <contrib_module> @@ -151,7 +151,7 @@ a test phplintmodule ../custom/<custom_module> ### PHP LOC -PHP LOC prints several metrics about your code, like the average size of a class. +[PHP LOC](https://github.com/sebastianbergmann/phploc) prints several metrics about your code, like the average size of a class. To execute PHP LOC on the console: @@ -159,9 +159,9 @@ To execute PHP LOC on the console: a test phploc <file_ordirectory> ``` -### PHP Mess Detection +### PHP Mess Detector -PHP Mess Detection is a more detailed analysis comparing to code sniffer. It +[PHP Mess Detector](https://phpmd.org) is a more detailed analysis comparing to code sniffer. It uses several profiles like: * cleancode @@ -170,7 +170,7 @@ uses several profiles like: This analysis detects also code smells like the complexity (e.g. number of dependencies) of classes. -To execute PHP Mess Detection on the console: +To execute PHP Mess Detector on the console: ```phpmd a test phpmd <file_ordirectory> json <profile> @@ -191,7 +191,7 @@ This useful tool provides more information as [PHP LOC](#php-loc). It adds for e Note: **This can take a while depending on your module.** -You can execute PHP Metrics for a specific Drupal contrib module: +You can execute [PHP Metrics](https://github.com/phpmetrics/PhpMetrics) for a specific Drupal contrib module: ```phpmet a test phpmetricsmodule <contrib_module> -- GitLab