sabre-io / xml

sabre/xml is an XML library that you may not hate.
http://sabre.io/xml/
BSD 3-Clause "New" or "Revised" License
516 stars 77 forks source link

PHPstan error reported for startElementNs call #227

Closed phil-davis closed 1 year ago

phil-davis commented 2 years ago

phpstan reports:

------ ------------------------------------------------------------------------------------------- 
  Line   lib/Writer.php                                                                             
 ------ ------------------------------------------------------------------------------------------- 
  132    Parameter #3 $namespace of method XMLWriter::startElementNs() expects string, null given.  
 ------ ------------------------------------------------------------------------------------------- 

But https://www.php.net/manual/en/xmlwriter.startelementns.php documents the 3rd parameter as ?string - if I leave out the 3rd parameter, then PHPstan complains that it must be given - correct. But if I specify it as null then PHPstan also complains.

What code is supposed to be written?

staabm commented 2 years ago

fixed with https://github.com/phpstan/phpstan-src/pull/1772 so phpstan allows to pass null for the namespace arg