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

PHP 8.0+ "final private" functions should give error #8374

Closed
kkmuffme opened this issue Aug 5, 2022 · 3 comments · Fixed by #9442
Closed

PHP 8.0+ "final private" functions should give error #8374

kkmuffme opened this issue Aug 5, 2022 · 3 comments · Fixed by #9442

Comments

@kkmuffme
Copy link
Contributor

kkmuffme commented Aug 5, 2022

https://psalm.dev/r/ee7881fa31?php=8.1

"final private" functions should give error

https://php.watch/versions/8.0/final-private-function#final-private

Related #7668 #7666

@psalm-github-bot
Copy link

I found these snippets:

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

class Foo {
    /**
     * @return void
     */
    final private function bar() {}
}

$data = new Foo();
Psalm output (using commit ffc8c80):

INFO: UnusedVariable - 10:1 - $data is never referenced or the value is not used

@AndrolGenhald
Copy link
Collaborator

8.0 actually: https://3v4l.org/puSnk

@kkmuffme kkmuffme changed the title PHP8.1 "final private" functions should give error PHP 8.0+ "final private" functions should give error Aug 5, 2022
@weirdan
Copy link
Collaborator

weirdan commented Nov 19, 2022

Constructor should be allowed to be declared final private though: https://3v4l.org/iErYc

weirdan added a commit to weirdan/psalm that referenced this issue Mar 3, 2023
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