Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Kernel.stubphp #220

Merged
merged 2 commits into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/Stubs/common/Component/HttpKernel/Kernel.stubphp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Symfony\Component\HttpKernel;

class Kernel
{
/**
* @var string
*/
protected $environment;
}
27 changes: 27 additions & 0 deletions tests/acceptance/acceptance/Kernel.feature
Original file line number Diff line number Diff line change
@@ -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