Diferencia entre revisiones de «Configuración del archivo de PHPStan»

De Wiki Proyectos Beta
Ir a la navegación Ir a la búsqueda
(feat: add Configuración del archivo de PHPStan)
 
(feat: add Configuración del archivo de PHPStan)
Línea 1: Línea 1:
== Nivel máximo ==
== Symfony ==
 
=== Nivel máximo ===


Archivo phpstan.dist.neon
Archivo phpstan.dist.neon
Línea 11: Línea 13:
         - src/
         - src/
         - tests/
         - tests/
    autoload_files:
        - %rootDir%/../../../config/bootstrap.php
    bootstrapFiles:
        - %rootDir%/../../../vendor/autoload.php
    excludes_analyse:
        - %currentWorkingDirectory%/src/Kernel.php
        - %currentWorkingDirectory%/tests/bootstrap.php
    # Opcional: Añadir reglas específicas de Symfony
    symfony:
        container_xml_path: '%rootDir%/../../../var/cache/dev/App_KernelDevDebugContainer.xml'
    checkMissingIterableValueType: true
    checkGenericClassInNonGenericObjectType: true
    checkUnionTypes: true
    checkExplicitMixed: true
    inferPrivatePropertyTypeFromConstructor: true
    checkDynamicProperties: true
includes:
    - vendor/phpstan/phpstan-symfony/extension.neon
    - vendor/phpstan/phpstan-strict-rules/rules.neon
    - vendor/phpstan/phpstan-deprecation-rules/rules.neon
    - vendor/phpstan/phpstan-phpunit/extension.neon
    - vendor/phpstan/phpstan-doctrine/extension.neon

Revisión del 13:58 24 ago 2024

Symfony

Nivel máximo

Archivo phpstan.dist.neon

parameters:
   level: max
   paths:
       - bin/
       - config/
       - public/
       - src/
       - tests/
   autoload_files:
       - %rootDir%/../../../config/bootstrap.php
   bootstrapFiles:
       - %rootDir%/../../../vendor/autoload.php
   excludes_analyse:
       - %currentWorkingDirectory%/src/Kernel.php
       - %currentWorkingDirectory%/tests/bootstrap.php

   # Opcional: Añadir reglas específicas de Symfony
   symfony:
       container_xml_path: '%rootDir%/../../../var/cache/dev/App_KernelDevDebugContainer.xml'
   checkMissingIterableValueType: true
   checkGenericClassInNonGenericObjectType: true
   checkUnionTypes: true
   checkExplicitMixed: true
   inferPrivatePropertyTypeFromConstructor: true
   checkDynamicProperties: true

includes:
   - vendor/phpstan/phpstan-symfony/extension.neon
   - vendor/phpstan/phpstan-strict-rules/rules.neon
   - vendor/phpstan/phpstan-deprecation-rules/rules.neon
   - vendor/phpstan/phpstan-phpunit/extension.neon
   - vendor/phpstan/phpstan-doctrine/extension.neon