Doc #80494 [Ver->Csd]: DOMElement::remove not documented

[email protected] Sun, 12 Nov 2023 16:56:01 +0000
Newsgroups php.doc.bugs
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=80494&edit=1

 ID:                 80494
 Updated by:         [email protected]
 Reported by:        contact at perryrylance dot com
 Summary:            DOMElement::remove not documented
-Status:             Verified
+Status:             Closed
 Type:               Documentation Problem
 Package:            DOM XML related
 Operating System:   Windows 10
 PHP Version:        8.0.0
-Assigned To:        
+Assigned To:        nielsdos
 Block user comment: N
 Private report:     N

 New Comment:

The fix for this bug has been committed.
If you are still experiencing this bug, try to check out latest source from https://github.com/php/php-src and re-test.
Thank you for the report, and for helping us make PHP better.

Documented now


Previous Comments:
------------------------------------------------------------------------
[2021-11-09 12:05:09] [email protected]

> I do have one request - could I perhaps ask that the functions
> remove, before, after and friends could possibly return $this?

I think we should stick with the HTML standard, see
<https://dom.spec.whatwg.org/#interface-childnode>.

------------------------------------------------------------------------
[2021-05-11 06:11:53] contact at perryrylance dot com

Hi Benjamin

I see that more methods have been added to DOMElement, which is great.

I'd like to bring my library up to date, drop support for PHP < 7.0.0 and add return types and matching function signatures to your implementation.

I do have one request - could I perhaps ask that the functions remove, before, after and friends could possibly return $this?

My library facilitates method chaining, changing some of these functions to return void could break older projects.

If this is at all possible I'd massively appreciate it.

Thank you.

------------------------------------------------------------------------
[2020-12-08 11:43:07] contact at perryrylance dot com

Wonderful, thank you so much!

Looks like I can simply remove this from my implementation :)

Thanks again!

------------------------------------------------------------------------
[2020-12-08 11:30:44] [email protected]

Sorry, I am having a bad day, the problem is not the parameters, but that the PHP 8 api has "void" as return type, so my last attempt, this time its right :-)

public function remove(): void;

As a side-note, PHP 8 now contains so called stubs, that show the right signature directly in PHP code. See the DOM Extension and remove here: https://github.com/php/php-src/blob/master/ext/dom/php_dom.stub.php#L231

------------------------------------------------------------------------
[2020-12-08 11:28:26] [email protected]

I am sorry, i meant:

public function remove();

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=80494


--
Edit this bug report at https://bugs.php.net/bug.php?id=80494&edit=1