v3.0.0 - PHP 8.2 Modernization & Architectural Refinement
This major release introduces significant architectural improvements by leveraging PHP 8.2 features. It focuses on immutability, strict typing, and a more intuitive fluent API.
Main Changes
PHP 8.2 Requirement
- The minimum PHP version has been raised to 8.2.
- Full support for
declare(strict_types=1)across all components. - Implementation of
readonlyproperties to ensure object integrity and better memory management.
Interface & API Refactoring (Breaking Changes)
- ISetAttributeElement: Updated method signature to
setAttribute(string $name, mixed $value = null): self. This change enforces type safety and enables a fluent interface out of the box. - StrElement: The method
setParam()has been renamed toadd(). This change aligns the vocabulary with the rest of the package and supports a cleaner fluent syntax. - VoidElement: Replaced the legacy
TagAutoCloseConfigElementwith a more semantic and flattenedVoidElementclass, now compliant with modern HTML5 standards (includingembed,source,track, andwbr).
Enhanced StrElement Buffer
- Flexible Concatenation: When initialized without a format string,
StrElementnow acts as a neutral buffer, concatenating fragments without imposing automatic spaces. - Mixed Type Support: Parameters now accept
mixedtypes, allowing easier integration with objects and scalars.
Attribute Management
- AttributeElement: Refactored with simplified internal logic and
readonlystate. It now handlesnullvalues more elegantly for boolean HTML attributes (e.g.,required,disabled).
Infrastructure & Quality
- Composer: Metadata refined and keywords updated to reflect the current component scope.
- Dev Tools: Added native support for PHPUnit 10 and PHPStan for static analysis.
- Documentation: Updated support links for docs, source, and issue tracking.
Author: Estefanio N Santos
License: MIT