Skip to content

Fix DOMDocument::create*() return types#3737

Merged
ondrejmirtes merged 3 commits intophpstan:1.12.xfrom
staabm:dom
Dec 17, 2024
Merged

Fix DOMDocument::create*() return types#3737
ondrejmirtes merged 3 commits intophpstan:1.12.xfrom
staabm:dom

Conversation

@staabm
Copy link
Copy Markdown
Contributor

@staabm staabm commented Dec 17, 2024

@ondrejmirtes
Copy link
Copy Markdown
Member

I'd rather do benevolent unions here, because the failures are going to be rare.

@ondrejmirtes ondrejmirtes merged commit 73d0f13 into phpstan:1.12.x Dec 17, 2024
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you.

@dimadeush
Copy link
Copy Markdown

dimadeush commented Dec 17, 2024

@ondrejmirtes Sometimes I can see that doc from PHPStorm is not the same as documentation on the php web site. F.e.

/**
     * Adds new child at the end of the children
     * @link https://php.net/manual/en/domnode.appendchild.php
     * @param DOMNode $node <p>
     * The appended child.
     * </p>
     * @return DOMNode The node added.
     */
    public function appendChild(DOMNode $node) {}

But on the php web-site we can see next:

public DOMNode::appendChild(DOMNode $node): DOMNode|false

Currently I don't know where the "proper" way and maybe we need to communicate JetBrains as of PHPStorm jar plugin related. Will be done with link to this example. Also I don't know if other php functionality can have wrong description.

@dimadeush
Copy link
Copy Markdown

Created issue for JetBrains as several products can be related - https://youtrack.jetbrains.com/issue/WI-80068/Wrong-php-documentation-inside-php-jar-plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants