psalm-plugin-laravel/tests/acceptance/RequestTypes.feature
2021-07-06 16:28:37 +02:00

37 lines
884 B
Gherkin

Feature: Request types
\Illuminate\Http\Request has type support
Background:
Given I have the following config
"""
<?xml version="1.0"?>
<psalm totallyTyped="false">
<projectFiles>
<directory name="."/>
<ignoreFiles> <directory name="../../vendor"/> </ignoreFiles>
</projectFiles>
<plugins>
<pluginClass class="Psalm\LaravelPlugin\Plugin"/>
</plugins>
</psalm>
"""
And I have the following code preamble
"""
<?php declare(strict_types=1);
namespace Tests\Psalm\LaravelPlugin\Sandbox;
use \Illuminate\Http\Request;
"""
Scenario: input returns various types
Given I have the following code
"""
function test(Request $request): bool
{
return $request->input('foo', false);
}
"""
When I run psalm
Then I see no errors