fix: provide mixed for lower laravel versions

This commit is contained in:
Feek 2020-06-07 00:23:54 -07:00
parent af5e562210
commit d4eb8d58e5
2 changed files with 57 additions and 0 deletions

View 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) { }
}

View 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