Skip to content

Releases: andanteproject/nullable-embeddable-bundle

v1.0.1

22 Nov 00:46

Choose a tag to compare

Added

PHPStan Extension

  • NEW: PHPStan static analysis extension to validate #[NullableEmbeddable] classes and prevent common runtime errors
  • The extension automatically validates three critical rules:
    1. Property Initialization: Flags properties with non-null default values outside the constructor (e.g., private bool $enabled = false;), which cause Doctrine hydration issues
    2. Nullable Columns: Ensures all #[Column] mappings are nullable (either via PHP ?Type or explicit nullable: true), preventing database constraint violations when embeddables are set to null
    3. Nested Embeddables: Validates that embedded objects with explicit non-null default values are nullable (uninitialized properties are allowed)

Installation

  • Automatic: Works via phpstan/extension-installer (already in dev dependencies)
  • Manual: Add vendor/andanteproject/nullable-embeddable-bundle/extension.neon to your PHPStan config

Why This Matters

This extension helps developers catch configuration errors before runtime that would otherwise cause:

  • Database integrity constraint violations (NOT NULL column errors)
  • Phantom entity updates in Doctrine's UnitOfWork
  • Difficult-to-debug hydration issues

Strongly recommended for all projects using this bundle.

Full Changelog: v1.0.0...v1.0.1

First release

12 Nov 19:21

Choose a tag to compare

Initial Release

  • Initial release of NullableEmbeddableBundle
  • Support for nullable Doctrine embeddables with custom business logic
  • Processor interface for determining null state
  • PHP 8.5+ closure processor support
  • Symfony 5.x, 6.x, 7.x compatibility
  • Doctrine ORM 2.x, 3.x compatibility