- Notifications
You must be signed in to change notification settings - Fork 114
[0.3.0] Remove circular dependency on illuminate/collections #168
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits Select commit Hold shift + click to select a range
8cb993a Move illuminate/collections to a dev dependency only
jessarcher 25e20f5 Remove internal use of collections
jessarcher 46c353b try removing collections in tests
driesvints af8a808 wip
crynobone cf6fe32 wip
crynobone ddf4894 Fix code styling
crynobone 580bbee wip
crynobone ee070c0 Merge remote-tracking branch 'upstream/remove-collections-dep' into r…
crynobone 7698716 wip
crynobone 195fa50 wip
crynobone b7b1466 Fix code styling
crynobone d3b5dfc wip
crynobone 3ca49ad wip
crynobone e11bfa1 wip
crynobone 1b7ce44 Fix collection dependency check
jessarcher 19b152c Remove collections from data providers when not installed
jessarcher 9606ba8 Fix code styling
jessarcher 6fcfd9a Refactor tests that didn't require collections
jessarcher a467b1c Formatting
jessarcher caed656 Fix test
jessarcher 2881100 Update .github/workflows/tests.yml
crynobone 304b51a wip
crynobone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| <?php | ||
| | ||
| namespace Laravel\Prompts\Support; | ||
| | ||
| use Closure; | ||
| | ||
| /** | ||
| * @internal | ||
| */ | ||
| class Utils | ||
| { | ||
| /** | ||
| * Determine if all items in an array match a truth test. | ||
| * | ||
| * @param array<array-key, mixed> $values | ||
| */ | ||
| public static function allMatch(array $values, Closure $callback): bool | ||
| { | ||
| foreach ($values as $key => $value) { | ||
| if (! $callback($value, $key)) { | ||
| return false; | ||
| } | ||
| } | ||
| | ||
| return true; | ||
| } | ||
| | ||
| /** | ||
| * Get the last item from an array or null if it doesn't exist. | ||
| * | ||
| * @param array<array-key, mixed> $array | ||
| */ | ||
| public static function last(array $array): mixed | ||
| { | ||
| return array_reverse($array)[0] ?? null; | ||
| } | ||
| | ||
| /** | ||
| * Returns the key of the first element in the array that satisfies the callback. | ||
| * | ||
| * @param array<array-key, mixed> $array | ||
| */ | ||
| public static function search(array $array, Closure $callback): int|string|false | ||
| { | ||
| foreach ($array as $key => $value) { | ||
| if ($callback($value, $key)) { | ||
| return $key; | ||
| } | ||
| } | ||
| | ||
| return false; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.