Skip to content

Decouple ValueObject from immutable-object and enforce strict equality.#19

Merged
gustavofreze merged 2 commits intomainfrom
feature/develop
Apr 20, 2026
Merged

Decouple ValueObject from immutable-object and enforce strict equality.#19
gustavofreze merged 2 commits intomainfrom
feature/develop

Conversation

@gustavofreze
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 20, 2026 18:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR decouples ValueObject from tiny-blocks/immutable-object and tightens equals() semantics by requiring same-class comparison and strict property equality, along with related documentation and tooling updates.

Changes:

  • Removed the Immutable dependency from the ValueObject contract and dropped the immutability trait usage.
  • Updated equals() to enforce same-class checks and strict comparison of object properties.
  • Updated project tooling/docs (Infection config, CI actions versions, Makefile targets, README/FAQ, repo config files).

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/ValueObjectBehavior.php Enforces same-class + strict get_object_vars() equality.
src/ValueObject.php Removes Immutable extension from the public interface.
tests/ValueObjectTest.php Adjusts equality test cases to match stricter semantics.
README.md Updates guidance and adds FAQ describing strict equality behavior.
composer.json Removes immutable-object dependency; refreshes metadata/dev tooling.
infection.json.dist Changes mutator configuration.
.github/workflows/ci.yml Updates artifact action versions; removes bcmath extension.
Makefile Adds composer normalize to configure; adds show-outdated target.
.gitattributes Adds normalization/diff driver settings and updates export-ignore list.
.editorconfig Adds editor formatting defaults.
.github/copilot-instructions.md Adds Copilot guidance referencing .claude/ rules.
.claude/** Introduces repo-wide rules for modeling, testing, documentation, and workflows.
Comments suppressed due to low confidence (1)

src/ValueObject.php:22

  • The docblock for equals() still states equality is based only on property values. After this change, equality also requires the same concrete class (and the comparison is strict), so the interface docs should be updated to reflect the actual contract.
    /**
     * Compares this ValueObject with another to determine if they are equal.
     * Two ValueObjects are considered equal if their properties have the same values.
     *
     * @param ValueObject $other The ValueObject to compare with.
     * @return bool True if the objects are equal, false otherwise.
     */

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .gitattributes
Comment thread src/ValueObjectBehavior.php
Comment thread src/ValueObjectBehavior.php
Comment thread tests/ValueObjectTest.php
Comment thread README.md
Comment thread composer.json
Comment thread infection.json.dist
@gustavofreze gustavofreze merged commit 879293b into main Apr 20, 2026
10 checks passed
@gustavofreze gustavofreze deleted the feature/develop branch April 20, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants