Skip to content

\Dom "legacy" methods not recognised #823

Description

@gwythan

Ref: https://www.php.net/manual/en/class.dom-element.php

Hmm, this is going to be messy.

In PHP 8.4 the \Dom library of classes is the 'modern' equivalent of the decades-old \DOM library (note change in case)

PHP8.4 specifies new methods and attributes for the classes in the \Dom library.

phptools is doing fine (in my limited testing) with recognising and auto-completing these new definitions, but it does not recognise the fact that the new \Dom classes ALSO include the methods and attributes defined in the classic \DOM library.

As a simple illustration, here is a valid code snippet that runs perfectly well in PHP8.4, but the methods of the old \DOM\Element class are not recognised in the new \Dom\Element class.

Image

I have not checked all of the \Dom class definitions with phptools, just the ones I'm using in a project, so it may be worth doing a deep dive into the documentation to see where phptools is false flagging methods as unrecognised.

Thank you!

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfeatureNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions