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

Kernel.stubphp is creating a PropertyNotSetInConstructor error #225

Open
VincentLanglet opened this issue Nov 2, 2021 · 6 comments
Open

Comments

@VincentLanglet
Copy link
Contributor

Ref #220 (comment)

The following code

class AppKernel extends Kernel
{
    use MicroKernelTrait;

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

is giving a PropertyNotSetInConstructor error.

@enumag @seferov do you see a workaround ?

@enumag
Copy link
Contributor

enumag commented Nov 2, 2021

That's odd. It's a protected property so the responsibility of setting it lies in the parent Kernel class. Perhaps it might help adding the constructor which sets it into the stub? If that doesn't help then I think it's psalm bug.

@VincentLanglet
Copy link
Contributor Author

I tried to add

    public function __construct(string $environment, bool $debug)
    {
        $this->environment = $environment;
        $this->debug = $debug;
    }

inside the stub without success.

It's even worst because I end with the same error for the debug property.

Seems like a psalm bug. cc @weirdan @orklah

@weirdan
Copy link
Member

weirdan commented Dec 5, 2021

@VincentLanglet mind creating a reproducer in a separate repo?

@VincentLanglet
Copy link
Contributor Author

@andrew-demb
Copy link
Contributor

Can anyone help with provide steps to fix this issue?
Should it be fixed in vimeo/psalm or psalm-plugin-symfony?

@VincentLanglet
Copy link
Contributor Author

There is a reproducer here: vimeo/psalm#7075, so I assume it should be fixed in vimeo/psalm

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

No branches or pull requests

4 participants