yusufkandemir / microdata-parser

Parse microdata from HTML documents with ease. PHP Implementation of W3C Microdata to JSON Specification.
MIT License
15 stars 10 forks source link

Typed property YusufKandemir\MicrodataParser\MicrodataDOMDocument::$xpath must not be accessed before initialization #4

Closed joshua-bn closed 6 months ago

joshua-bn commented 1 year ago

Detailed description

Typed property YusufKandemir\MicrodataParser\MicrodataDOMDocument::$xpath must not be accessed before initialization

This happens when you use fromDOMDocument()

Using loadHTML() and loadHTMLFile() don't have this issue because they set $xpath. Needs a way to set $xpath outside of those methods.

yusufkandemir commented 6 months ago

Thanks for reporting 👏 Fixed in https://github.com/yusufkandemir/microdata-parser/releases/tag/v1.0.1