Skip to content

Conversation

@henriquemoody
Copy link
Member

The constructor of Result has many arguments, but that's not the primary reason why I'm making this change. I want to change the constructor, and it will become more complicated, so having this named constructor will be useful in the next refactoring.

With this change, I also made the id mandatory. That made the constructor look neater and most to promote almost all properties to the constructor.

Another change was removing the fromAdjacent method, which was quite confusing. I created the asAdjacentOf method, which is a bit clearer. If anything, it makes all static methods named constructors. It will be a bit more verbose, but more intuitive.

The constructor of `Result` has many arguments, but that's not the
primary reason why I'm making this change. I want to change the
constructor, and it will become more complicated, so having this named
constructor will be useful in the next refactoring.

With this change, I also made the `id` mandatory. That made the
constructor look neater and most to promote almost all properties to the
constructor.

Another change was removing the `fromAdjacent` method, which was quite
confusing. I created the `asAdjacentOf` method, which is a bit clearer.
If anything, it makes all static methods named constructors. It will be
a bit more verbose, but more intuitive.
@codecov
Copy link

codecov bot commented Dec 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.49%. Comparing base (4840527) to head (94ddfcd).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1570      +/-   ##
============================================
+ Coverage     97.48%   97.49%   +0.01%     
- Complexity      987      988       +1     
============================================
  Files           205      205              
  Lines          2227     2237      +10     
============================================
+ Hits           2171     2181      +10     
  Misses           56       56              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@henriquemoody henriquemoody merged commit 94ddfcd into Respect:main Dec 26, 2025
5 checks passed
@henriquemoody henriquemoody deleted the core/result-constructor branch December 26, 2025 21:42
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.

1 participant