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

@psalm-yield not documented #5397

Closed
simPod opened this issue Mar 15, 2021 · 4 comments · Fixed by #7849
Closed

@psalm-yield not documented #5397

simPod opened this issue Mar 15, 2021 · 4 comments · Fixed by #7849

Comments

@simPod
Copy link
Contributor

simPod commented Mar 15, 2021

I have stumbled over @psalm-yield in 3rd party code. There's no mention of it in docs though I have found some traces in source code in this repo.

Edit: just found this, o'lol

private const WALL_OF_SHAME = [
'@psalm-assert-untainted',
'@psalm-consistent-constructor',
'@psalm-flow',
'@psalm-generator-return',
'@psalm-ignore-variable-method',
'@psalm-ignore-variable-property',
'@psalm-override-method-visibility',
'@psalm-override-property-visibility',
'@psalm-scope-this',
'@psalm-seal-methods',
'@psalm-stub-override',
'@psalm-taint-unescape',
'@psalm-yield',
];
🙃

@orklah
Copy link
Collaborator

orklah commented Oct 14, 2021

Is it bad that I have no idea what the majority of those does either? :D

@orklah
Copy link
Collaborator

orklah commented Oct 14, 2021

If anyone use those, please help the project and add some docs :)

@weirdan
Copy link
Collaborator

weirdan commented Oct 14, 2021

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/acfb878a1e
<?php

class C {
    /** @var int */
    private $prop = 1;
    public function do(Closure $c): void {
        $c->call($this);
    }
}

function f(): int {
    /** @psalm-scope-this C */
    return $this->prop;
};
Psalm output (using commit b8a2ba2):

No issues!

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

Successfully merging a pull request may close this issue.

3 participants