Enable "PhanUndeclaredVariable" phan check
[lhc/web/wiklou.git] / tests / phan / config.php
index 84132b9..bebdd3d 100644 (file)
@@ -38,6 +38,10 @@ return [
                function_exists( 'tideways_enable' ) ? [] : [ 'tests/phan/stubs/tideways.php' ],
                class_exists( PEAR::class ) ? [] : [ 'tests/phan/stubs/mail.php' ],
                class_exists( Memcached::class ) ? [] : [ 'tests/phan/stubs/memcached.php' ],
+               // Per composer.json, PHPUnit 6 is used for PHP 7.0+, PHPUnit 4 otherwise.
+               // Load the interface for the version of PHPUnit that isn't installed.
+               // Phan only supports PHP 7.0+ (and not HHVM), so we only need to stub PHPUnit 4.
+               class_exists( PHPUnit_TextUI_Command::class ) ? [] : [ 'tests/phan/stubs/phpunit4.php' ],
                [
                        'maintenance/7zip.inc',
                        'maintenance/backup.inc',
@@ -68,7 +72,6 @@ return [
                'maintenance/',
                'mw-config/',
                'resources/',
-               'skins/',
                'vendor/',
        ],
 
@@ -96,8 +99,6 @@ return [
                'maintenance/language/',
                // External class
                'includes/libs/jsminplus.php',
-               // separate repositories
-               'skins/',
        ],
 
        /**
@@ -370,8 +371,6 @@ return [
                "PhanUndeclaredStaticMethod",
                // approximate error count: 11
                "PhanUndeclaredTypeReturnType",
-               // approximate error count: 27
-               "PhanUndeclaredVariable",
                // approximate error count: 58
                "PhanUndeclaredVariableDim",
        ],