{"id":18766310,"url":"https://github.com/navarr/iterable_to_array","last_synced_at":"2025-12-08T23:30:17.331Z","repository":{"id":46250658,"uuid":"411820673","full_name":"navarr/iterable_to_array","owner":"navarr","description":"A PHP class that handles the boilerplate for converting an iterable into an array","archived":false,"fork":false,"pushed_at":"2022-01-11T02:29:15.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-29T07:32:24.276Z","etag":null,"topics":["array","hacktoberfest","iterable","php-library"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/navarr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-29T20:29:34.000Z","updated_at":"2022-01-11T02:29:18.000Z","dependencies_parsed_at":"2022-09-07T16:50:32.370Z","dependency_job_id":null,"html_url":"https://github.com/navarr/iterable_to_array","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navarr%2Fiterable_to_array","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navarr%2Fiterable_to_array/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navarr%2Fiterable_to_array/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navarr%2Fiterable_to_array/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/navarr","download_url":"https://codeload.github.com/navarr/iterable_to_array/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239669053,"owners_count":19677662,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array","hacktoberfest","iterable","php-library"],"created_at":"2024-11-07T18:40:11.337Z","updated_at":"2025-12-08T23:30:17.288Z","avatar_url":"https://github.com/navarr.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IterableToArray::convert\n[![Latest Stable Version](http://poser.pugx.org/navarr/iterable-to-array/v)](https://packagist.org/packages/navarr/iterable-to-array)\n[![Total Downloads](http://poser.pugx.org/navarr/iterable-to-array/downloads)](https://packagist.org/packages/navarr/iterable-to-array)\n[![Latest Unstable Version](http://poser.pugx.org/navarr/iterable-to-array/v/unstable)](https://packagist.org/packages/navarr/iterable-to-array)\n[![License](http://poser.pugx.org/navarr/iterable-to-array/license)](https://packagist.org/packages/navarr/iterable-to-array)  \n[![Tests](https://github.com/navarr/iterable_to_array/actions/workflows/commit.yml/badge.svg)](https://github.com/navarr/iterable_to_array/actions/workflows/commit.yml)\n[![Code Coverage](https://codecov.io/gh/navarr/iterable_to_array/branch/main/graph/badge.svg?token=DJRUJTV2GW)](https://app.codecov.io/gh/navarr/iterable_to_array/)\n[![Mutation score](https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fnavarr%2Fiterable_to_array%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/navarr/iterable_to_array/main)\n\nA simple utility class that handles the boilerplate of converting an iterable into an array.\n\nThe goal of this utility is to be an in-place replacement for iterator_to_array whenever one must handle an iterable.\n\n## Installation\n\n    composer require navarr/iterable-to-array\n\n## Usage\n\n```php\n\u003c?php\n\nuse Navarr\\Utils\\IterableToArray\n\n// ...\n\n$array = IterableToArray::convert($iterable);\n\n// This replaces:\n\n$array = is_array($iterable) ? $iterable : iterator_to_array($iterable);\n```\n\nThis also has (what should be unnecessary) forward compatibility for a scenario where an object passes the `iterable` type check but is neither an `array` nor a `\\Traversable`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavarr%2Fiterable_to_array","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnavarr%2Fiterable_to_array","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavarr%2Fiterable_to_array/lists"}