Skip to content

Commit

Permalink
Ignore nullable return form SimpleXMLElement::addChild()
Browse files Browse the repository at this point in the history
It seems unrealistic to require users to perform a null check every time
they call this method.
  • Loading branch information
greg0ire committed May 4, 2023
1 parent 7483f4d commit a6016e3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions stubs/extensions/simplexml.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class SimpleXMLElement implements Traversable, Countable

final public function __construct(string $data, int $options = 0, bool $dataIsURL = false, string $namespaceOrPrefix = '', bool $isPrefix = false) {}

/** @psalm-ignore-nullable-return */
public function addChild(string $qualifiedName, ?string $value = null, ?string $namespace = null): ?SimpleXMLElement {}

public function addAttribute(string $qualifiedName, string $value, ?string $namespace = null): void {}
Expand Down

0 comments on commit a6016e3

Please sign in to comment.