Skip to content

v3.0.0 - PHP 8.2 Modernization & Architectural Refinement

Choose a tag to compare

@estefanionsantos estefanionsantos released this 20 Apr 17:53

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 readonly properties 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 to add(). This change aligns the vocabulary with the rest of the package and supports a cleaner fluent syntax.
  • VoidElement: Replaced the legacy TagAutoCloseConfigElement with a more semantic and flattened VoidElement class, now compliant with modern HTML5 standards (including embed, source, track, and wbr).

Enhanced StrElement Buffer

  • Flexible Concatenation: When initialized without a format string, StrElement now acts as a neutral buffer, concatenating fragments without imposing automatic spaces.
  • Mixed Type Support: Parameters now accept mixed types, allowing easier integration with objects and scalars.

Attribute Management

  • AttributeElement: Refactored with simplified internal logic and readonly state. It now handles null values 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