Skip to content

Releases: rubricate/element

v4.0.0 - Strict Typing Enforcement & Engine Modernization

Choose a tag to compare

@estefanionsantos estefanionsantos released this 29 Jun 19:50

This major release upgrades the core infrastructure to PHP 8.2+, introducing strict type safety, modernized language features, and enhanced architectural robustness across the entire element generator.

Breaking Changes

  • Minimum PHP Version: The component now strictly requires PHP 8.2 or higher.
  • Strict Type Declarations: Added declare(strict_types=1); to all core interfaces and implementation files, enforcing rigid type constraints on data mutation.

Refactoring & Modernization

  • Constructor Property Promotion: Applied to concrete classes (StrElement, CreateElement, AttributeElement) to eliminate boilerplate state assignments.
  • Return Type Signatures: Upgraded fluent method wrappers (addChild, setAttribute, add) from self to static return types to prevent cascading context inheritance breaks.
  • Array Collections Optimization: Modernized internal data management inside ArrElement leveraging lazy-loaded ArrayObject tracking and strict string/int union validation logic.
  • Standards Compliance: Rewrote code formatting across the entire vendor tree to strictly align with modern PSR-12 / PER Coding Standards.

Documentation

  • Metadata Badges: Structured dynamic status shields inside the README.md for real-time tracking of package downloads, versions, and licensing metadata.
  • Description Sync: Updated package descriptors to reflect comprehensive XML and HTML node construction engines.
composer require rubricate/element:^4.0

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

# v2.2.1 - Modern PHP Release (Recommended php7.2+)

Choose a tag to compare

@estefanionsantos estefanionsantos released this 20 Apr 00:35

This is the recommended stable version for modern PHP environments. It includes critical bug fixes and full support for strict typing and return type declarations.

Why upgrade to v2.2.x?

Unlike the legacy v1.x branch, this version is optimized for PHP 7.2 and 8.x, offering better performance, type safety, and compatibility with modern development standards.

Fixed in this release

  • Critical Fix (ArrElement): Resolved a persistence issue where internal state was lost during property initialization. The ArrElement::get() method now correctly implements lazy loading with persistence.
  • Improved Type Safety: Added explicit return type hints (: object, : string) across the CreateElement class and its interfaces, ensuring compliance with strict_types=1.

Key Features

  • Strict Typing: Fully utilizes declare(strict_types=1) for predictable behavior and fewer runtime errors.
  • Fluent Component Architecture: Build complex HTML structures with a clean, chainable API.
  • Modern Standards: Optimized for current PHP engines (7.2, 7.4, 8.0, 8.1, 8.2+).

Installation

To use this modern version, update your composer.json:

{
    "require": {
        "rubricate/element": "^2.2"
    }
}

# v1.0.0 - Initial Stable Release (PHP 5.4+)

Choose a tag to compare

@estefanionsantos estefanionsantos released this 20 Apr 00:27

We are excited to announce the first stable release of the Rubricate Element component. This version is specifically architected to provide a fluent and reliable way to generate HTML elements in legacy and modern PHP environments.

Features

  • Fluent Interface: Chainable methods for a more readable and expressive syntax.
  • Void Element Support: Automatic handling of self-closing tags (like <br />, <img />) based on the TagAutoCloseConfigElement configuration.
  • Dynamic Attributes: Robust management of HTML attributes through the AttributeElement integration.
  • Nesting Capabilities: Easily add child elements to build complex HTML structures programmatically.

🛠 Technical Specifications

  • PHP Compatibility: Full support for PHP 5.4, 5.5, 5.6, 7.x, and 8.x.
  • Memory Efficient: Optimized for low memory consumption, ideal for legacy servers.
  • PSR-compliant: Follows standard autoloading and naming conventions.

Installation

Update your composer.json to use the stable version:

{
    "require": {
        "rubricate/element": "^1.0"
    }
}