-
Notifications
You must be signed in to change notification settings - Fork 651
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
Clean up unreflectable callmap methods #9526
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -350,21 +350,8 @@ class InternalCallMapHandlerTest extends TestCase | |
*/ | ||
private static array $ignoredUnreflectableFunctions = [ | ||
'closure::__invoke', | ||
'curlfile::__wakeup', | ||
'domimplementation::__construct', | ||
'generator::__wakeup', | ||
'gmp::__construct', | ||
'gmp::__tostring', | ||
'intliterator::__construct', | ||
'mysqli::disable_reads_from_master', | ||
'mysqli::rpl_query_type', | ||
'mysqli::send_query', | ||
'mysqli::set_local_infile_default', | ||
'mysqli::set_local_infile_handler', | ||
'mysqli_driver::embedded_server_end', | ||
'mysqli_driver::embedded_server_start', | ||
'pdo::__sleep', | ||
'pdo::__wakeup', | ||
'pdo::cubrid_schema', | ||
'pdo::pgsqlcopyfromarray', | ||
'pdo::pgsqlcopyfromfile', | ||
|
@@ -378,31 +365,17 @@ class InternalCallMapHandlerTest extends TestCase | |
'pdo::sqlitecreateaggregate', | ||
'pdo::sqlitecreatecollation', | ||
'pdo::sqlitecreatefunction', | ||
'pdostatement::__sleep', | ||
'pdostatement::__wakeup', | ||
'simplexmlelement::__get', | ||
'simplexmlelement::offsetexists', | ||
'simplexmlelement::offsetget', | ||
'simplexmlelement::offsetset', | ||
'simplexmlelement::offsetunset', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SimpleXmlElement implements array access even though it's not documented. If we keep offset functions will that help psalm accept array access on the object? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, though it would be great to also update the stub There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like SimpleXmlElement now implements RecursiveIterator in PHP 8. I think need to fix how stubs are loaded for target php version first. https://3v4l.org/bNNkh#v8.0.28 |
||
'spldoublylinkedlist::__construct', | ||
'splfileinfo::__wakeup', | ||
'splfixedarray::current', | ||
'splfixedarray::key', | ||
'splfixedarray::next', | ||
'splfixedarray::rewind', | ||
'splfixedarray::valid', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SplFixedArray now implements IteratorAggregate. |
||
'splheap::__construct', | ||
'splmaxheap::__construct', | ||
'splobjectstorage::__construct', | ||
'splpriorityqueue::__construct', | ||
'splstack::__construct', | ||
'weakmap::__construct', | ||
'weakmap::current', | ||
'weakmap::key', | ||
'weakmap::next', | ||
'weakmap::rewind', | ||
'weakmap::valid', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No idea where these came from. WeakMap was added in PHP 8. I added the correct methods. |
||
]; | ||
|
||
private static Codebase $codebase; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SimpleXmlElement also implement property access without defining a __get() function. I don't know if psalm needs this to allow arbitrary property access.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Psalm does indeed checks for __get/__set method existence at some point