mirror of
https://github.com/danog/psalm-plugin-laravel.git
synced 2024-11-26 20:34:48 +01:00
fix: provide mixed for lower laravel versions
This commit is contained in:
parent
af5e562210
commit
d4eb8d58e5
21
src/Stubs/InteractsWithInput.stubphp
Normal file
21
src/Stubs/InteractsWithInput.stubphp
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Http\Concerns;
|
||||
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Str;
|
||||
use SplFileInfo;
|
||||
use stdClass;
|
||||
|
||||
trait InteractsWithInput
|
||||
{
|
||||
/**
|
||||
* Retrieve an input item from the request.
|
||||
*
|
||||
* @param string|null $key
|
||||
* @param mixed $default
|
||||
* @return mixed
|
||||
*/
|
||||
public function input($key = null, $default = null) { }
|
||||
}
|
36
tests/acceptance/RequestTypes.feature
Normal file
36
tests/acceptance/RequestTypes.feature
Normal file
@ -0,0 +1,36 @@
|
||||
Feature: redirect
|
||||
The global redirect helper will return the correct type depending on args
|
||||
|
||||
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
|
Loading…
Reference in New Issue
Block a user