Skip to content

Remove doctrine/instantiator dependency #11

@tabennett

Description

@tabennett

Problem

doctrine/instantiator is listed under require-dev in composer.json, but Mapper.php uses it in production code paths. This means production installations silently break unless the dependency happens to be present.

Beyond the placement error, the dependency itself should be removed entirely. Holloway entities are plain PHP classes — instantiation should be handled at the discretion of the user, not forced to use a doctrine utility class.

Required Changes

  • Remove doctrine/instantiator from composer.json entirely (both require and require-dev)
  • Refactor Mapper.php to instantiate entities without it

Breaking Change

Removing this dependency changes how entity instantiation works internally. Any user-space code that relies on the current behavior (constructor bypass) will be affected. In order to mitigate this, existing users should install doctrine/instantiator themselves or write their own methods for instantiating entities (in a way that bypasses the constructor) as need be.

This requires a major version bump with a BC break release note.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions