mirror of
https://github.com/danog/psalm-plugin-laravel.git
synced 2025-01-23 05:41:11 +01:00
DB facade alias support (#126)
* Convert DB facade stub method to static
This commit is contained in:
parent
da4e6bcec3
commit
cf9fbd88c0
@ -12,5 +12,5 @@ class DB extends Facade
|
|||||||
*
|
*
|
||||||
* @psalm-taint-sink sql $value
|
* @psalm-taint-sink sql $value
|
||||||
*/
|
*/
|
||||||
public function raw($value) {}
|
public static function raw($value) {}
|
||||||
}
|
}
|
31
tests/acceptance/DBFacadeAlias.feature
Normal file
31
tests/acceptance/DBFacadeAlias.feature
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
Feature: DB facade alias
|
||||||
|
Want to check that the alias of the DB facade works properly
|
||||||
|
|
||||||
|
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>
|
||||||
|
"""
|
||||||
|
|
||||||
|
Scenario: call the DB facade alias
|
||||||
|
Given I have the following code
|
||||||
|
"""
|
||||||
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Tests\Psalm\LaravelPlugin\Sandbox;
|
||||||
|
|
||||||
|
function test(): void {
|
||||||
|
\DB::raw(1);
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
When I run Psalm
|
||||||
|
Then I see no errors
|
Loading…
x
Reference in New Issue
Block a user