XMLWriter::*Ns() accepts null in $prefix#383
XMLWriter::*Ns() accepts null in $prefix#383ondrejmirtes merged 1 commit intophpstan:masterfrom spaze:patch-1
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 :-) |
| '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.
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!