Commit 3225ef6b authored by Klaus Purer's avatar Klaus Purer
Browse files

tests(phpstan): Replace deprecated config options and simplify config

parent 16d49edd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -28,6 +28,6 @@
    },
    "require-dev": {
        "phpunit/phpunit": "^6.0 || ^7.0",
        "phpstan/phpstan": "^0.12.25"
        "phpstan/phpstan": "^0.12.31"
    }
}
+0 −4
Original line number Diff line number Diff line
@@ -149,10 +149,6 @@
        <exclude name="Generic.Commenting.Todo.CommentFound"/>
    </rule>

    <!-- Not compliant yet, should be fixed in the future. -->
    <rule ref="PEAR.Commenting.FunctionComment.MissingParamComment">
        <exclude-pattern>coder_sniffer/DrupalPractice/Sniffs/CodeAnalysis/VariableAnalysisSniff.php</exclude-pattern>
    </rule>
    <rule ref="PEAR.Commenting.FileComment.Missing">
        <exclude-pattern>tests/Drupal</exclude-pattern>
        <exclude-pattern>tests/DrupalPractice/Test</exclude-pattern>
+3 −7
Original line number Diff line number Diff line
@@ -4,20 +4,16 @@ parameters:
        - coder_sniffer
        - tests
    excludes_analyse:
        # Copied legacy code that we don't care much about.
        - 'coder_sniffer/DrupalPractice/Sniffs/CodeAnalysis/VariableAnalysisSniff.php'
        # Test files that should not be checked.
        - 'tests/*/*.tpl.php'
        - 'tests/*/*.api.php'
        - 'tests/*/good.php'
        - 'tests/*/bad.php'
        - 'tests/*/drupal[678]/*.php'
    # The tests directory is not autoloaded by Composer. Make PHPStan aware of
    # it.
    autoload_directories:
        - tests
    autoload_files:
    bootstrapFiles:
        - tests/Drupal/phpunit-bootstrap.php
        # PHPStan does not find the constants in this file, so load it manually.
        - vendor/squizlabs/php_codesniffer/src/Util/Tokens.php
    ignoreErrors:
        # PHPStan does not support variable variables, see https://github.com/phpstan/phpstan/issues/2810
        -
+1 −3
Original line number Diff line number Diff line
<?php

require 'vendor/autoload.php';
require 'CoderSniffUnitTest.php';
require 'tests/Drupal/CoderSniffUnitTest.php';
require 'vendor/squizlabs/php_codesniffer/autoload.php';
// PHPStan does not find the constants in this file, so load it manually.
require_once 'vendor/squizlabs/php_codesniffer/src/Util/Tokens.php';