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

Abstracted more repeating code, added abstract for fields, made creat… #6008

Open
wants to merge 6 commits into
base: 4.x
Choose a base branch
from

Conversation

bytes-commerce
Copy link
Contributor

…ion of new fields more streamlined and adapted signature to match possible inputs more strictly.

This PR streamlines how Fields are generated; instead of lots of code duplication (that increases the costs for maintenance), we can deduct it to an Abstract.

In an attempt to further reduce abstracts, this change can be later on used to even further simplify static calls by having the full API of the fields at hand.

@bytes-commerce

This comment was marked as outdated.

@bytes-commerce bytes-commerce marked this pull request as ready for review November 7, 2023 12:28

public function getAsDto(): FieldDto;

Copy link
Collaborator

@OskarStark OskarStark Nov 8, 2023

Choose a reason for hiding this comment

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

adding methods to an interface is a BC break, you should use @method annotations instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, I am afraid, but using @method will not improve the situation; the opposite is the case, as IDEs would indicate methods that are not even there maybe, creating a booby trap for developers. I am considering a individual Interface for the existing fields, which then would be BC compatible by just extending the given Interface. 🤔 Something like FieldTraitAwareInterface or similar. Thanks for the heads up!

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