-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Description
Bug report
Code snippet that reproduces the problem
/**
* @param mixed $vcard
* @return mixed
*/
public function enrichVcard($vcard)
{
if (isset($vcard->FN)) {
$vcard->FULLNAME = (string)$vcard->FN;
}
}
gives
Line CardDav/Backend.php
------ ----------------------------------------------------
252 Access to an undefined property object::$FULLNAME.
------ ----------------------------------------------------
Here is a similar stan: https://phpstan.org/r/2e641f19-1d8a-486c-8be6-06233e1ee9a8
Expected output
No error. It should be possible to intentionally create properties on objects.
Vcard is an actual Sabre\VObject\Document that uses getter/setter magic to provide dynamic properties. I need to convince stan that these properties exist. mixed doesn't work, object doesn't work, using the actual type as hint doesn't work, also another hint right above doesn't work:
/** @var \stdClass $vcard */
I've re-read #928 but couldn't find the problem.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels