Skip to content

Update DOM stub and add separate SimpleXML stub#8140

Merged
orklah merged 4 commits intovimeo:masterfrom
AndrolGenhald:stubs-dom-simplexml
Jun 22, 2022
Merged

Update DOM stub and add separate SimpleXML stub#8140
orklah merged 4 commits intovimeo:masterfrom
AndrolGenhald:stubs-dom-simplexml

Conversation

@AndrolGenhald
Copy link
Copy Markdown
Collaborator

No description provided.


public function valid(): bool {}

public function current(): SimpleXMLIterator {}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Technically incorrect, it can return null until PHP 8.1, but I don't think calling current() directly is very common, so it's probably preferable to trade the very uncommon false negative for much more common false positives.

Related to php/doc-en#1640

Comment on lines -939 to +941
foreach ($xml->children() as $img) {
$children = $xml->children();
assert($children !== null);
foreach ($children as $img) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This was a false negative: https://3v4l.org/rqvMc

@AndrolGenhald AndrolGenhald requested a review from orklah June 22, 2022 06:59
@AndrolGenhald AndrolGenhald added the release:fix The PR will be included in 'Fixes' section of the release notes label Jun 22, 2022
@orklah
Copy link
Copy Markdown
Collaborator

orklah commented Jun 22, 2022

Thanks!

@orklah orklah merged commit cbc597f into vimeo:master Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:fix The PR will be included in 'Fixes' section of the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants