diff --git a/composer.json b/composer.json index ea87eb3..71116da 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "require": { "php": "^7.1", "ext-simplexml": "*", - "vimeo/psalm": "^3.7", + "vimeo/psalm": "^3.11", "symfony/framework-bundle": "^3.0 || ^4.0 || ^5.0" }, "require-dev": { diff --git a/src/Handler/ClassHandler.php b/src/Handler/ClassHandler.php index fae6f13..726cee1 100644 --- a/src/Handler/ClassHandler.php +++ b/src/Handler/ClassHandler.php @@ -56,16 +56,6 @@ class ClassHandler implements AfterClassLikeAnalysisInterface, AfterMethodCallAn Union &$return_type_candidate = null ) { switch ($declaring_method_id) { - case 'Symfony\Component\HttpFoundation\Request::getcontent': - if ($return_type_candidate) { - $removeType = 'resource'; - if (isset($expr->args[0]->value->name->parts[0])) { - /** @psalm-suppress MixedArrayAccess */ - $removeType = 'true' === $expr->args[0]->value->name->parts[0] ? 'string' : 'resource'; - } - $return_type_candidate->removeType($removeType); - } - break; case 'Doctrine\ORM\EntityManagerInterface::getrepository': case 'Doctrine\Persistence\ObjectManager::getrepository': if (!$expr->args[0]->value instanceof ClassConstFetch) { diff --git a/src/Plugin.php b/src/Plugin.php index 89adfb5..4a1d036 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -39,5 +39,9 @@ class Plugin implements PluginEntryPointInterface } else { $api->registerHooksFromClass(ContainerHandler::class); } + + foreach (glob(__DIR__ . '/Stubs/*.stubphp') as $stubFilePath) { + $api->addStubFile($stubFilePath); + } } } diff --git a/src/Stubs/Request.stubphp b/src/Stubs/Request.stubphp new file mode 100644 index 0000000..4cc4a4c --- /dev/null +++ b/src/Stubs/Request.stubphp @@ -0,0 +1,21 @@ +