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

::attach has wrong name $info, expecting $data as defined by SplObjectStorage::attach #11133

Closed
kamil-tekiela opened this issue Oct 20, 2024 · 1 comment · Fixed by #11134
Closed

Comments

@kamil-tekiela
Copy link
Contributor

https://psalm.dev/r/a10fdd663a

I was expecting no error as the parameter name is $info which is exactly what it should be. https://www.php.net/manual/en/splobjectstorage.attach.php Where is $data coming from?

Copy link

I found these snippets:

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

class A extends SplObjectStorage {
 public function attach(object $object, mixed $info = array()): void {}   
}
Psalm output (using commit 03ee02c):

ERROR: MissingTemplateParam - 3:7 - A has missing template params when extending SplObjectStorage, expecting 2

ERROR: ParamNameMismatch - 4:47 - Argument 2 of A::attach has wrong name $info, expecting $data as defined by SplObjectStorage::attach

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 a pull request may close this issue.

1 participant