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

Feature: random in Toolkit\A and Toolkit\Collection #4270

Merged

Conversation

adamkiss
Copy link
Contributor

@adamkiss adamkiss commented Apr 11, 2022

This PR …

Features

New A::random() and $collection->random() methods to get one or multiple random items from arrays and collections, optionally shuffled. Unless shuffled, the overall order of the returned items is kept.

Breaking changes

None

Ready?

  • Unit tests for fixed bug/feature
  • In-code documentation (wherever needed)
  • Tests and checks all pass

For review team

@distantnative said he doesn't hate me yet

Copy link
Member

@lukasbestle lukasbestle left a comment

Choose a reason for hiding this comment

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

💛

src/Toolkit/A.php Outdated Show resolved Hide resolved
src/Toolkit/Collection.php Outdated Show resolved Hide resolved
tests/Toolkit/ATest.php Outdated Show resolved Hide resolved
@adamkiss
Copy link
Contributor Author

@lukasbestle this was quite light on the comments, Lukas 😄 I'll look at the changes later.

adamkiss and others added 3 commits April 12, 2022 15:59
Co-authored-by: Lukas Bestle <lukas@getkirby.com>
Co-authored-by: Lukas Bestle <lukas@getkirby.com>
Co-authored-by: Lukas Bestle <lukas@getkirby.com>
@adamkiss
Copy link
Contributor Author

@lukasbestle you were right, updated. Are we still in the window for 3.6.5?

@lukasbestle lukasbestle added this to the 3.6.6 milestone Apr 15, 2022
@lukasbestle lukasbestle added the type: feature 🎉 Adds a feature (requests → feedback.getkirby.com) label Apr 15, 2022
Copy link
Member

@lukasbestle lukasbestle left a comment

Choose a reason for hiding this comment

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

👍

3.6.5 is already nearing release, but we can include this PR in 3.6.6, which is planned to be released in two weeks.

@adamkiss
Copy link
Contributor Author

🤝

@bastianallgeier bastianallgeier merged commit cd083d0 into getkirby:develop Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature 🎉 Adds a feature (requests → feedback.getkirby.com)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants