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
XMLWriter::*Ns() accepts null in $prefix #383
Conversation
> prefix: The namespace prefix. If prefix is NULL, the namespace will be omitted. Docs: https://www.php.net/xmlwriter-start-attribute-ns https://www.php.net/xmlwriter-start-element-ns https://www.php.net/xmlwriter-write-attribute-ns https://www.php.net/xmlwriter-write-element-ns
Thank you! :) |
That was quick, thanks :-) Just realized that similar change needs to be applied to |
It might not need to be, check out what phpstan.org does, there's more complicated logic. If the signature is correct in https://github.com/phpstan/php-8-stubs, there's a high chance the analysis will be already correct too :) |
Aha, thanks. Currently (without this patch applied), analyzing And yes, https://github.com/phpstan/php-8-stubs/blob/main/stubs/ext/xmlwriter/xmlwriter_write_element_ns.php et al. seems correct with |
Yes, my plan is to sync PHP 8 stubs with 7.4 functionMap (in an automated way) for things that actually haven't changed in PHP 8 :) |
I see, thanks! Looking forward to a new release so I don't need to do some magic to make analysis pass on both PHP 7.4 & 8.0! Got a bit confused when I've ignored the error message on 7.x and then analyzing on PHP 8.0 said "no error" so thanks for showing me php-8-stubs. (Yeah, I know I could somehow use different config files but nah I'll happily wait :-) |
@@ -13110,19 +13110,19 @@ | |||
'XMLWriter::startDTDElement' => ['bool', 'qualifiedname'=>'string'], | |||
'XMLWriter::startDTDEntity' => ['bool', 'name'=>'string', 'isparam'=>'bool'], | |||
'XMLWriter::startElement' => ['bool', 'name'=>'string'], | |||
'XMLWriter::startElementNS' => ['bool', 'prefix'=>'string', 'name'=>'string', 'uri'=>'string'], | |||
'XMLWriter::startElementNS' => ['bool', 'prefix|null'=>'string', 'name'=>'string', 'uri'=>'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.
The null
should be in the 'string'
part. Sorry for that, remedied in #388
Hi,
Docs:
https://www.php.net/xmlwriter-start-attribute-ns
https://www.php.net/xmlwriter-start-element-ns
https://www.php.net/xmlwriter-write-attribute-ns
https://www.php.net/xmlwriter-write-element-ns
Thanks!