HTMLdoc v1.7.0
This release fixes a number of bugs and make more use of type hints and docblocks for improved ease of development and stability:
- Added
@propertytags forhtmldoc::__get()andhtmldoc::__set() - Updated
htmldoc::offsetSet()to assume that there is always an index comment::minify()now checks that there is contentcustom::__construct()now check that$tagNameis notnull- Tightened properties in
tag - Fixed bug in
tag::append()where clones were not spliced correctly tag::getIndex()now check that the parent is notnull- Fixed some typing issues in
tag::minify() - Fixed return value issue in
tag::attr() - Fixed some potential typing errors
- Fixed issue in
tag::minify()where the parent was not checked fornull - Updated some incorrect types in phpDoc tags
- Moved code that parses CSS selectors into its own class
- Updated
htmldoc::find()to use the new class - Updated
htmldoc::minify()to move the code that sorts attributes into its own method - Updated
htmldoc::open(),htmldoc::getCharsetFromHtml(), andhtmldoc::minify()to reduce cognitive complexity - Updated
htmldoc::save()to return the compiled code instead of true if saved, as it returns the code if no file is specified - Updated tests
- Fixed bug in
htmldoc::offsetGet()andhtmldoc::current()where it returned the child object instead of a newhtmldocobject containing the child node - Updated signature of
ArrayAccessmethods to match the parent - Fixed PHP 7.4 compatibility issue where the type hint
mixedwas not introduced until PHP 8 - Added
#[\ReturnTypeWillChange]hint tohtmldoc::offsetGet()andhtmldoc::__get()