Skip to content

Conversation

silasjoisten
Copy link
Collaborator

@silasjoisten silasjoisten commented Mar 14, 2025

This PR improves the DX. It allows us to use the collection with strings or the value object e.g.

new FieldCollection([
    'author',
    'text',
]);

Internally its automatically converted to a list of value objects.

or the classic way

new FieldCollection([
    new Field('author'),
    new Field('text'),
]);

@silasjoisten silasjoisten self-assigned this Mar 14, 2025
Copy link

@Copilot 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.

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.24%. Comparing base (31332b5) to head (52d3cc6).

Additional details and impacted files
@@             Coverage Diff              @@
##             master      #25      +/-   ##
============================================
+ Coverage     92.18%   92.24%   +0.05%     
- Complexity      295      299       +4     
============================================
  Files            64       64              
  Lines          1152     1160       +8     
============================================
+ Hits           1062     1070       +8     
  Misses           90       90              

☔ 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.

@silasjoisten silasjoisten changed the title Allow strings|int in collection constructor Allow strings or int in collection constructor Mar 14, 2025
@silasjoisten silasjoisten changed the title Allow strings or int in collection constructor Allow strings or int in Collections Mar 14, 2025
@silasjoisten silasjoisten added the enhancement New feature or request label Mar 14, 2025
@edodusi edodusi merged commit d921cdb into master Mar 14, 2025
4 checks passed
@edodusi edodusi deleted the feature/collections-allow-strings branch March 14, 2025 16:44
/**
* @test
*/
public function constructWithString(): void
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
public function constructWithString(): void
public function constructWithInt(): void

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants