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

Add PHPStan updates #1

Merged
merged 1 commit into from
Jul 23, 2018
Merged

Add PHPStan updates #1

merged 1 commit into from
Jul 23, 2018

Conversation

muglug
Copy link
Contributor

@muglug muglug commented Jul 23, 2018

No description provided.

@@ -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'],
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just removed that line

@TysonAndre TysonAndre merged commit a707263 into phan:master Jul 23, 2018
@@ -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'],
Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, sorry

TysonAndre added a commit to phan/phan that referenced this pull request Jul 23, 2018
@muglug muglug deleted the phpstan-fixes branch July 23, 2018 01:58
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 this pull request may close these issues.

None yet

2 participants