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

Create Kernel.stubphp #220

merged 2 commits into from
Oct 8, 2021

Conversation

enumag
Copy link
Contributor

@enumag enumag commented Oct 5, 2021

class Kernel extends BaseKernel
{
    use MicroKernelTrait;

    protected function configureContainer(ContainerConfigurator $container): void
    {
        $container->import('../config/{packages}/*.yaml');
        $container->import('../config/{packages}/' . $this->environment . '/*.yaml');
		// ...
    }
}

Psalm:

ERROR: MixedOperand
at /app/src/Kernel.php:17:54
Right operand cannot be mixed (see https://psalm.dev/059)
        $container->import('../config/{packages}/' . $this->environment . '/*.yaml');

@enumag
Copy link
Contributor Author

enumag commented Oct 8, 2021

@seferov fixed and added a test

Copy link
Member

@seferov seferov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@enumag thank you!

@seferov seferov merged commit de574cc into psalm:master Oct 8, 2021
@franmomu
Copy link

franmomu commented Oct 18, 2021

This stub introduces a PropertyNotSetInConstructor when using for example:

class AppKernel extends Kernel
{
    use MicroKernelTrait;

    public function __construct()
    {
        parent::__construct('test', true);
    }
}

due to vimeo/psalm#2319 I guess, I don't know if there is a workaround for this 😕

The original issue maybe can be solved by using $this->getEnvironment()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants