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

Strongly type FieldList #11198

Open
maxime-rainville opened this issue Apr 14, 2024 · 1 comment
Open

Strongly type FieldList #11198

maxime-rainville opened this issue Apr 14, 2024 · 1 comment

Comments

@maxime-rainville
Copy link
Contributor

maxime-rainville commented Apr 14, 2024

Many methods on FieldList will silently fail if you give them bad types.

e.g.: $fields->addFieldsToTab('Root.Main', $field1, $field2, $field3) will only add $field1 to the tab.

Acceptance criteria

  • Methods in FieldList that are not covered by other interfaces are strongly typed and have an explicit return type.
  • addFieldsToTab hard fails if the second parameter is not an array.
  • All of kitchen sink is shown to pass CI before any PRs are merged

Shared CI workflow run

PRs

@GuySartorelli
Copy link
Member

FieldList is not in a vacuum - it's the subclass of ArrayList which is a subclass of ViewableData, uses a trait, and implements several interfaces.

The ACs should specify whether any of that is in scope, or if this card is only for methods defined directly in FieldList, or if it's mostly about methods defined directly in FieldList but the implementor can choose to strongly-type other methods if they feel it's relevant to the goal of the card (i.e. making it clearer what can/cannot be passed into FieldList).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants