jasny / jasny/improved-php-iterable
Add toAssoc() and toList()
- Dominant language
- PHP
- Stars
- 14
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
The `toArray()` method outputs an associative array. If you want the values, you explicitly need to use the `values()` step. Adding specific methods for associative and sequential arrays would be better.
`toArray()` would be deprecated, or add parameter `?bool $preserveKeys = null` and pass it to `iterable_to_array()`.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the existing `toArray()` implementation and the `iterable_to_array()` entry point. Review how associative and sequential results are currently represented, then clarify whether the intended API is `toAssoc()`/`toList()`, a `toArray()` parameter, or deprecation; the chosen behavior should be implemented and covered by the project's tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100