diff --git a/src/Command/CommandHelper.php b/src/Command/CommandHelper.php index 1261814cef..32fd7bae98 100644 --- a/src/Command/CommandHelper.php +++ b/src/Command/CommandHelper.php @@ -479,6 +479,50 @@ public static function begin( $errorOutput->writeLineFormatted(sprintf('Please implement PHPStan\Type\ExpressionTypeResolverExtension interface instead and register it as a service.')); } + if ($projectConfig !== null) { + $parameters = $projectConfig['parameters'] ?? []; + /** @var bool $checkMissingIterableValueType */ + $checkMissingIterableValueType = $parameters['checkMissingIterableValueType'] ?? true; + if (!$checkMissingIterableValueType) { + $errorOutput->writeLineFormatted('⚠️ You\'re using a deprecated config option checkMissingIterableValueType ⚠️️'); + $errorOutput->writeLineFormatted(''); + + $featureToggles = $container->getParameter('featureToggles'); + if (!((bool) $featureToggles['bleedingEdge'])) { + $errorOutput->writeLineFormatted('It\'s strongly recommended to remove it from your configuration file'); + $errorOutput->writeLineFormatted('and add the missing array typehints.'); + $errorOutput->writeLineFormatted(''); + } + + $errorOutput->writeLineFormatted('If you want to continue ignoring missing typehints from arrays,'); + $errorOutput->writeLineFormatted('add missingType.iterableValue error identifier to your ignoreErrors:'); + $errorOutput->writeLineFormatted(''); + $errorOutput->writeLineFormatted('parameters:'); + $errorOutput->writeLineFormatted("\tignoreErrors:"); + $errorOutput->writeLineFormatted("\t\t-"); + $errorOutput->writeLineFormatted("\t\t\tidentifier: missingType.iterableValue"); + $errorOutput->writeLineFormatted(''); + } + + /** @var bool $checkGenericClassInNonGenericObjectType */ + $checkGenericClassInNonGenericObjectType = $parameters['checkGenericClassInNonGenericObjectType'] ?? true; + if (!$checkGenericClassInNonGenericObjectType) { + $errorOutput->writeLineFormatted('⚠️ You\'re using a deprecated config option checkGenericClassInNonGenericObjectType ⚠️️'); + $errorOutput->writeLineFormatted(''); + $errorOutput->writeLineFormatted('It\'s strongly recommended to remove it from your configuration file'); + $errorOutput->writeLineFormatted('and add the missing generic typehints.'); + $errorOutput->writeLineFormatted(''); + $errorOutput->writeLineFormatted('If you want to continue ignoring missing typehints from generics,'); + $errorOutput->writeLineFormatted('add missingType.generics error identifier to your ignoreErrors:'); + $errorOutput->writeLineFormatted(''); + $errorOutput->writeLineFormatted('parameters:'); + $errorOutput->writeLineFormatted("\tignoreErrors:"); + $errorOutput->writeLineFormatted("\t\t-"); + $errorOutput->writeLineFormatted("\t\t\tidentifier: missingType.generics"); + $errorOutput->writeLineFormatted(''); + } + } + $tempResultCachePath = $container->getParameter('tempResultCachePath'); $createDir($tempResultCachePath);