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

Make static analysis happy / fix autocompletion #12

Open
LordSimal opened this issue Jul 18, 2024 · 0 comments
Open

Make static analysis happy / fix autocompletion #12

LordSimal opened this issue Jul 18, 2024 · 0 comments

Comments

@LordSimal
Copy link

Currently, I have to suppress a bunch of warnings related to phpstan/psalm when doing something like

return (new Document())

    ->heading(2)
        ->text('Alfred')
    ->end()

    ->bulletlist() // <--- it breaks here
        ->item()
            ->paragraph()
                ->text('Some text.')
            ->end()
        ->end()
    ->end();

because the return type of ->end() is ?self aka a nullable Node.

image

But e.g. bulletlist() only exists on one of these classes:

image

This causes the effect, that after the first end() call no further auto-completion is present as well.

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

1 participant