Decouple ValueObject from immutable-object and enforce strict equality.#19
Merged
gustavofreze merged 2 commits intomainfrom Apr 20, 2026
Merged
Decouple ValueObject from immutable-object and enforce strict equality.#19gustavofreze merged 2 commits intomainfrom
gustavofreze merged 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
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
Immutabledependency from theValueObjectcontract 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.