mirror of
https://github.com/danog/psalm-plugin-symfony.git
synced 2024-11-30 04:29:10 +01:00
Add Kernel.stubphp (#220)
This commit is contained in:
parent
7b19393d11
commit
de574cc9f2
11
src/Stubs/common/Component/HttpKernel/Kernel.stubphp
Normal file
11
src/Stubs/common/Component/HttpKernel/Kernel.stubphp
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\HttpKernel;
|
||||
|
||||
class Kernel
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $environment;
|
||||
}
|
27
tests/acceptance/acceptance/Kernel.feature
Normal file
27
tests/acceptance/acceptance/Kernel.feature
Normal file
@ -0,0 +1,27 @@
|
||||
@symfony-5
|
||||
Feature: Kernel
|
||||
|
||||
Background:
|
||||
Given I have Symfony plugin enabled
|
||||
|
||||
Scenario: MixedOperand error about $environment is not raised
|
||||
Given I have the following code
|
||||
"""
|
||||
<?php
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
|
||||
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
abstract class Kernel extends BaseKernel
|
||||
{
|
||||
use MicroKernelTrait;
|
||||
|
||||
protected function configureContainer(ContainerConfigurator $container): void
|
||||
{
|
||||
$container->import('../config/{packages}/' . $this->environment . '/*.yaml');
|
||||
}
|
||||
}
|
||||
"""
|
||||
When I run Psalm
|
||||
Then I see no errors
|
Loading…
Reference in New Issue
Block a user