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

support generics #171

Merged
merged 2 commits into from
Jan 2, 2025
Merged

support generics #171

merged 2 commits into from
Jan 2, 2025

Conversation

lekoala
Copy link
Contributor

@lekoala lekoala commented Nov 15, 2024

helps with #170

this allows to get \SilverStripe\ORM\DataList<\MyObject> MyObjects() notation and is, currently, only enabled if you want it in the yml config to avoid side effects on older projects

@@ -155,7 +157,11 @@ protected function generateTagsForDataLists($fields, $listType = DataList::class
$listName = $this->getAnnotationClassName($listType);
$dataObjectName = $this->getAnnotationClassName($dataObjectName);

$tagString = "{$listName}|{$dataObjectName}[] {$fieldName}()";
if ($useGenerics) {
Copy link
Member

Choose a reason for hiding this comment

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

I would remove the else bit, and leave line 158 intact. That way, it's set, then overridden if the else is true.
Just a personal preference of avoiding elses where possible

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed i also prefer it that way

@Firesphere Firesphere merged commit bdbf7f9 into silverleague:master Jan 2, 2025
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