Add Kernel.stubphp (#220)

This commit is contained in:
Jáchym Toušek 2021-10-08 09:19:03 +02:00 committed by GitHub
parent 7b19393d11
commit de574cc9f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,11 @@
<?php
namespace Symfony\Component\HttpKernel;
class Kernel
{
/**
* @var string
*/
protected $environment;
}

View 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