-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add PHPStan updates #1
Conversation
FunctionSignatureMap.php
Outdated
@@ -9943,6 +9943,7 @@ | |||
'simplexml_load_file' => ['SimpleXMLElement|false', 'filename'=>'string', 'class_name='=>'string', 'options='=>'int', 'ns='=>'string', 'is_prefix='=>'bool'], | |||
'simplexml_load_string' => ['SimpleXMLElement|false', 'data'=>'string', 'class_name='=>'string', 'options='=>'int', 'ns='=>'string', 'is_prefix='=>'bool'], | |||
'SimpleXMLElement::__construct' => ['void', 'data'=>'string', 'options='=>'int', 'data_is_url='=>'bool', 'ns='=>'string', 'is_prefix='=>'bool'], | |||
'SimpleXMLElement::__get' => ['SimpleXMLElement', 'name'=>'string'], |
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.
This implements magic getters internally, but not through __get(). DynamicPropertyMap is what Phan uses to keep track of this type of edge case.
php > $x = new SimpleXMLElement('<b>x</b>');
php > $x->__get('b');
Warning: Uncaught Error: Call to undefined method SimpleXMLElement::__get() in php shell code:1
Stack trace:
#0 {main}
thrown in php shell code on line 1
php > var_export($x->b);
SimpleXMLElement::__set_state(array(
))
The rest of the changes look good
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.
Just removed that line
@@ -9859,7 +9859,7 @@ | |||
'SessionUpdateTimestampHandler::validateId' => ['char', 'id'=>'string'], | |||
'SessionUpdateTimestampHandlerInterface::updateTimestamp' => ['bool', 'key'=>'string', 'val'=>'string'], | |||
'SessionUpdateTimestampHandlerInterface::validateId' => ['bool', 'key'=>'string'], | |||
'set_error_handler' => ['?string', 'error_handler'=>'null|callable(int,string,string,int,array):bool|callable(int,string,string,int):bool|callable(int,string,string):bool|callable(int,string):bool', 'error_types='=>'int'], | |||
'set_error_handler' => ['?callable', 'error_handler'=>'null|callable(int,string,string=,int=,array=):bool', 'error_types='=>'int'], |
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.
I overlooked the changes to the parameter union type - Those will need to be changed due to differences in Phan/Psalm's casting rules for callables, as discussed earlier.
The change to the return type makes sense.
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.
The fix was committed to master.
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.
Awesome, sorry
Syncing changes from phpstan in phan/PHPSignatures#1
No description provided.