Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the make:publication command to use the new field value objects #790

Conversation

caendesilva
Copy link
Member

@caendesilva caendesilva commented Dec 30, 2022

This will bring better type safety and eventually reduce complexity in the command class and action. See #789

Also makes some refactors to the types themselves and surrounding logics as I now know better how they fit together.

@caendesilva caendesilva changed the base branch from master to publications-feature December 30, 2022 14:43
@codecov
Copy link

codecov bot commented Dec 30, 2022

Codecov Report

Merging #790 (c679d89) into publications-feature (eb087d3) will decrease coverage by 0.08%.
The diff coverage is n/a.

@@                    Coverage Diff                     @@
##             publications-feature     #790      +/-   ##
==========================================================
- Coverage                   99.86%   99.77%   -0.09%     
+ Complexity                   2856     1427    -1429     
==========================================================
  Files                         346      173     -173     
  Lines                        7178     3595    -3583     
==========================================================
- Hits                         7168     3587    -3581     
+ Misses                         10        8       -2     
Impacted Files Coverage Δ
...cations/Models/PublicationFieldValues/TagField.php 75.00% <0.00%> (-25.00%) ⬇️
...tions/Models/PublicationFieldValues/ArrayField.php 87.50% <0.00%> (-12.50%) ⬇️
...rk/Features/Publications/PublicationFieldTypes.php 91.30% <0.00%> (-8.70%) ⬇️
...ations/Models/PublicationFieldValues/TextField.php 100.00% <0.00%> (ø)
...rk/src/Console/Commands/MakePublicationCommand.php
...c/Framework/Actions/ConvertsArrayToFrontMatter.php
...rc/Framework/Actions/CreatesNewPublicationPage.php
...tions/Models/PublicationFieldValues/ArrayField.php
...cations/Models/PublicationFieldValues/TagField.php
...ations/Models/PublicationFieldValues/TextField.php
... and 169 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

While this adds an extra loop, it reduces assertion counts.
Either way, I'm not that concerned about performance for an action line this.
… it twice in class body

This also removes an edge case where the filename different than the canonical entry as the clock could switchover between those calls
@caendesilva caendesilva marked this pull request as ready for review December 30, 2022 16:17
@caendesilva caendesilva merged commit 325925c into publications-feature Dec 30, 2022
@caendesilva caendesilva deleted the refactor-publication-field-values-to-object-oriented-types branch December 30, 2022 16:18
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