Philip Ardery
Philip Ardery
I'm getting an unknown function error. I tried explicitly including the function `use function PHPStan\dumpType;` and that didn't help. I see the function in my vendor directory, but for what...
Oops, maybe the result I am looking for is in PHPStan, not the browser: ``` $ ./bin/phpstan Note: Using configuration file /path/to/project/phpstan.neon. 445/445 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% ------ ------------------------------------------------------------------------- Line src/App/Controller/MyController.php ------...
These are all results I expect, as `ParameterBag::get()` returns mixed. I've proposed a solution to Symfony that could be helpful if accepted: https://github.com/symfony/symfony/issues/45775
Well, that's good news! But I am afraid I do have the latest `phpstan` (1.4.10) and `phpstan-symfony` (1.1.7). I am using `phpstan/extension-installer` (1.1.0), which I believe enables the extensions automatically....
I'm looking at the symfony 5 config for `phpstan-symfony`: ``` use App\Kernel; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Dotenv\Dotenv; require __DIR__ . '/../vendor/autoload.php'; (new Dotenv())->bootEnv(__DIR__ . '/../.env'); $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);...
looks like `bootEnv()` is not available on Symfony 4.4's `Dotenv`
this did not change the output of the `dumpType` calls: ``` use App\Kernel; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Dotenv\Dotenv; require __DIR__ . '/../config/bootstrap.php'; require __DIR__ . '/../vendor/autoload.php'; (new Dotenv())->loadEnv(__DIR__ . '/../.env'); $kernel...
Found something potentially interesting. `ParameterBagInterface` [shows](https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php#L50) return type of `@return array|bool|string|int|float|\UnitEnum|null`. But the `Symfony\Component\HttpFoundation\ParameterBag` does not extend this interface (like `\Symfony\Component\DependencyInjection\ParameterBag` does). Instead, the HttpFoundation bag [hints](https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/HttpFoundation/ParameterBag.php#L73): `@return mixed`. It's...
Hmm. @ondrejmirtes Do you suggest I manually install phpstan-symfony? Not sure how to proceed with testing...
@ondrejmirtes, any input on my previous comment? I am not fully competent on how stubbing works, but is it really possible to type hint a completely different object? Request defines:...