packagist damienharper/auditor 4.1.0

4 hours ago

auditor 4.1.0

A milestone release on the road to 5.0. auditor 4.1 decouples the core package from
Doctrine ORM/DBAL, promotes PHP attributes to a provider-agnostic core namespace, and
introduces auditor-doctrine-provider
as the new standalone home for Doctrine support.


✨ What's new

auditor-doctrine-provider — Doctrine support is now a standalone package

The DoctrineProvider and all related classes have been extracted from auditor into a
dedicated package: damienharper/auditor-doctrine-provider.

The auditor core is now Doctrine-free. Only symfony/event-dispatcher and
symfony/options-resolver remain as hard dependencies — making it easier to use auditor
with any ORM or persistence layer.

composer require damienharper/auditor-doctrine-provider

No action required for existing users. The built-in DoctrineProvider still works in
4.x — it is deprecated and will be removed in 5.0. Migrate at your own pace.

Core attribute namespace — DH\Auditor\Attribute

PHP attributes (#[Auditable], #[Ignore], #[Security]) are now defined in the
provider-agnostic core namespace DH\Auditor\Attribute, making them available to any
provider — not just Doctrine.

// Before (4.0, still works but deprecated)
use DH\Auditor\Provider\Doctrine\Auditing\Attribute\Auditable;

// After (4.1, canonical)
use DH\Auditor\Attribute\Auditable;

The old DH\Auditor\Provider\Doctrine\Auditing\Attribute\* classes remain as deprecated
thin extensions through 4.x and will be removed in 5.0. The AttributeLoader recognises
both namespaces transparently — no change needed on entities that already use the old import.


🔨 Deprecations

The following are deprecated in 4.1 and will be removed in 5.0:

  • All 36 classes, interfaces, and traits under DH\Auditor\Provider\Doctrine\ (use
    damienharper/auditor-doctrine-provider instead)
  • DH\Auditor\Provider\Doctrine\Auditing\Attribute\AuditableDH\Auditor\Attribute\Auditable
  • DH\Auditor\Provider\Doctrine\Auditing\Attribute\IgnoreDH\Auditor\Attribute\Ignore
  • DH\Auditor\Provider\Doctrine\Auditing\Attribute\SecurityDH\Auditor\Attribute\Security

🚀 Migrating from 4.0

For most applications the migration boils down to:

# 1. Install the standalone provider
composer require damienharper/auditor-doctrine-provider

# 2. Update attribute imports (optional in 4.x, required before 5.0)
# DH\Auditor\Provider\Doctrine\Auditing\Attribute\* → DH\Auditor\Attribute\*

No schema changes. No behavioral changes. Audit data is fully preserved.


What's Changed

Architecture

  • Decouple Doctrine from core and deprecate built-in DoctrineProvider by @DamienHarper in #306
  • Promote PHP attributes to core namespace DH\Auditor\Attribute by @DamienHarper in #304

Dependencies


References

Full Changelog: 4.0.0...4.1.0

Don't miss a new auditor release

NewReleases is sending notifications on new releases.