chore(config): update phpcs, phpstan, and phpunit configurations

- Updated phpcs.xml for improved formatting and structure.
- Added Pest and Webmozart Assert extensions to phpstan.neon.
- Enhanced phpunit.xml with additional test suites and configurations.
- Bumped version in pint.json and added new rule for PHPDoc tags.
- Updated rector.php to include new sets for code quality improvements.
- Added .gitkeep files in Feature and Integration test directories.
This commit is contained in:
Jérémy Munsch 2026-09-20 14:50:20 +02:00
parent ec6c1cf9f0
commit f01990be88
Signed by: forge-joniko
GPG key ID: D7EFE2F5CB6CC0E4
11 changed files with 515 additions and 434 deletions

View file

@ -14,6 +14,19 @@ trim_trailing_whitespace = false
[*.{php,json}]
indent_size = 4
[*.{css,scss}]
[*.blade.php]
indent_size = 2
[*.{yml,yaml}]
indent_size = 2
[{compose,docker-compose}.{yml,yaml}]
indent_size = 2
[*.scss]
indent_size = 2
quote_type = single
[*.css]
indent_size = 2
quote_type = single

View file

@ -17,9 +17,9 @@ stages:
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
- if: "$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS"
when: never
- if: '$CI_COMMIT_BRANCH'
- if: "$CI_COMMIT_BRANCH"
variables:
PHP_CI_IMAGE: "registry.s-web.fr/ldc-web/projets/ldc-web-images-docker/uwil-local-8.5:latest"
@ -27,7 +27,7 @@ variables:
eslint:
rules:
- when: never
stylelint:
rules:
- when: never
@ -38,7 +38,7 @@ stylelint:
needs:
- job: composer_vendor_dev
artifacts: true
pint:
<<: *php-lint-base
script:
@ -58,7 +58,7 @@ composer_vendor_dev:
before_script:
- composer config gitlab-token.lab.s-web.fr "${CI_DEPLOY_USER}" "${CI_DEPLOY_PASSWORD}"
script:
- composer install --ignore-platform-reqs --no-interaction --no-scripts --prefer-dist
- composer install --ignore-platform-reqs --no-interaction --no-scripts --prefer-dist
artifacts:
paths:
- vendor/
@ -68,8 +68,7 @@ composer_vendor_dev:
optional: true
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH'
- if: "$CI_COMMIT_BRANCH"
# TEST
test:unit:

View file

@ -9,7 +9,10 @@
],
"license": "MIT",
"require": {
"php": "^8.5"
"php": "^8.5",
"ext-mbstring": "*",
"ramsey/uuid": "^4.9",
"symfony/polyfill-php86": "^1.41"
},
"require-dev": {
"ace-of-aces/intellipest": "^1.0",
@ -22,11 +25,10 @@
"pestphp/pest-plugin-type-coverage": "^4.0",
"php-parallel-lint/php-parallel-lint": "^1.4",
"phpstan/phpstan": "^2.2",
"phpstan/phpstan-webmozart-assert": "^2.0",
"phpunit/phpunit": "^12.5",
"ramsey/uuid": "^4.9",
"rector/rector": "^2.5",
"slevomat/coding-standard": "^8.22",
"symfony/polyfill-php86": "^1.41"
"slevomat/coding-standard": "^8.22"
},
"config": {
"optimize-autoloader": true,

803
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,52 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Php Coding Standard"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<description>Standard optimisé: Analyse statique complémentaire à Pint.</description>
<description>Standard optimisé: Analyse statique complémentaire à Pint.</description>
<arg name="colors" />
<arg name="extensions" value="php" />
<arg name="parallel" value="75" />
<file>src/</file>
<file>tests/</file>
<arg name="colors" />
<arg name="extensions" value="php" />
<arg name="parallel" value="75" />
<file>src/</file>
<file>tests/</file>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/storage/*</exclude-pattern>
<exclude-pattern>_ide_helper.php</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/storage/*</exclude-pattern>
<exclude-pattern>_ide_helper.php</exclude-pattern>
<rule ref="PSR12"/>
<rule ref="PSR12"/>
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
<rule ref="Generic.Metrics.CyclomaticComplexity">
<properties>
<property name="complexity" value="10"/>
<property name="absoluteComplexity" value="20"/>
</properties>
</rule>
<rule ref="Generic.Metrics.NestingLevel"/>
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
<rule ref="Generic.Metrics.CyclomaticComplexity">
<properties>
<property name="complexity" value="10"/>
<property name="absoluteComplexity" value="20"/>
</properties>
</rule>
<rule ref="Generic.Metrics.NestingLevel"/>
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Generic.PHP.ForbiddenFunctions"/>
<rule ref="Generic.PHP.NoSilencedErrors"/>
<rule ref="Squiz.PHP.Eval"/>
<rule ref="Squiz.PHP.GlobalKeyword"/>
<rule ref="Squiz.PHP.NonExecutableCode"/>
<rule ref="Squiz.Scope.StaticThisUsage"/>
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Generic.PHP.ForbiddenFunctions"/>
<rule ref="Generic.PHP.NoSilencedErrors"/>
<rule ref="Squiz.PHP.Eval"/>
<rule ref="Squiz.PHP.GlobalKeyword"/>
<rule ref="Squiz.PHP.NonExecutableCode"/>
<rule ref="Squiz.Scope.StaticThisUsage"/>
<rule ref="Generic.NamingConventions.ConstructorName"/>
<rule ref="Generic.NamingConventions.CamelCapsFunctionName"/>
<rule ref="Generic.NamingConventions.ConstructorName"/>
<rule ref="Generic.NamingConventions.CamelCapsFunctionName"/>
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="150"/>
<property name="absoluteLineLimit" value="250"/>
</properties>
</rule>
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="150"/>
<property name="absoluteLineLimit" value="250"/>
</properties>
</rule>
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<exclude-pattern>*/database/migrations/*</exclude-pattern>
</rule>
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<exclude-pattern>*/database/migrations/*</exclude-pattern>
</rule>
</ruleset>

View file

@ -1,3 +1,7 @@
includes:
- vendor/pestphp/pest/extension.neon
- vendor/phpstan/phpstan-webmozart-assert/extension.neon
parameters:
paths:
- src/

View file

@ -1,11 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.5/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true" failOnRisky="true" failOnWarning="true">
<testsuites>
<testsuite name="Architecture">
<directory suffix="Test.php">./tests/Architecture</directory>
</testsuite>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
<directory>tests/Unit</directory>
</testsuite>
<testsuite name="Integration">
<directory>tests/Integration</directory>
</testsuite>
<testsuite name="Feature">
<directory>tests/Feature</directory>
</testsuite>
<testsuite name="Architecture">
<directory>tests/Architecture</directory>
</testsuite>
</testsuites>
<source>

View file

@ -1,7 +1,11 @@
{
"version": "1.0.0",
"version": "1.0.1",
"preset": "psr12",
"rules": {
"no_superfluous_phpdoc_tags": {
"allow_mixed": true,
"remove_inheritdoc": false
},
"indentation_type": true,
"single_line_empty_body": false,
"types_spaces": {

View file

@ -12,10 +12,12 @@ return RectorConfig::configure()
])
->withPhpSets()
->withSets([
SetList::PHP_POLYFILLS,
SetList::CODE_QUALITY,
SetList::DEAD_CODE,
SetList::PRIVATIZATION,
SetList::TYPE_DECLARATION,
SetList::EARLY_RETURN,
SetList::PRIVATIZATION,
SetList::INSTANCEOF,
SetList::IF,
]);

0
tests/Feature/.gitkeep Normal file
View file

View file