-
-
Notifications
You must be signed in to change notification settings - Fork 947
polymorphic string based checks #1330
Copy link
Copy link
Closed
Description
I'm not sure if this is an error, as the code should check in a better way but I have come across the following
https://phpstan.org/r/051b7ab22cbb5241e32200e723a0bf3c
This should use instanceof ideally which resolves the issue, just wondering if code like this should also verify ?
Using something like
switch ($object->getType()) {
case something::class :
}
vs
switch (true) {
case $object instanceof something :
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels