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

Use iterable typehints #12

Closed
rotexdegba opened this issue Apr 4, 2023 · 1 comment
Closed

Use iterable typehints #12

rotexdegba opened this issue Apr 4, 2023 · 1 comment
Assignees
Labels
nice-to-have Features or enhancements that are not pressing but nice to have

Comments

@rotexdegba
Copy link
Member

rotexsoft/leanorm#28

@rotexdegba rotexdegba added the nice-to-have Features or enhancements that are not pressing but nice to have label Apr 4, 2023
@rotexdegba rotexdegba self-assigned this Apr 4, 2023
@rotexdegba
Copy link
Member Author

This issue is pointless now since variadic parameter signatures are now used in the Collection constructor and the Model's createNewCollection methods. Users looking to create collection objects directly via the collection constructor or via a Model's createNewCollection are now forced by the variadic signature to unpack an array of items that are strictly of \GDAO\Model\RecordInterface or its sub-types.

// CollectionInterface

public function __construct(
    \GDAO\Model $model, \GDAO\Model\RecordInterface ...$data
);


// Model

public function createNewCollection(\GDAO\Model\RecordInterface ...$list_of_records): \GDAO\Model\CollectionInterface { //...}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nice-to-have Features or enhancements that are not pressing but nice to have
Projects
None yet
Development

No branches or pull requests

1 participant