{"id":22452168,"url":"https://github.com/brenoroosevelt/php-array-functions","last_synced_at":"2025-03-27T12:28:43.474Z","repository":{"id":48212537,"uuid":"458279323","full_name":"brenoroosevelt/php-array-functions","owner":"brenoroosevelt","description":"A set of helpful array/iterables functions","archived":false,"fork":false,"pushed_at":"2022-02-16T20:21:48.000Z","size":186,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T17:12:55.046Z","etag":null,"topics":["array","at-least","at-most","dot-notation","dot-notation-array","functions","none","paginate","paginate-array","php","some"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brenoroosevelt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-11T17:26:36.000Z","updated_at":"2022-07-21T17:59:09.000Z","dependencies_parsed_at":"2022-08-21T09:20:08.053Z","dependency_job_id":null,"html_url":"https://github.com/brenoroosevelt/php-array-functions","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/brenoroosevelt%2Fphp-array-functions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brenoroosevelt%2Fphp-array-functions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brenoroosevelt%2Fphp-array-functions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brenoroosevelt%2Fphp-array-functions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brenoroosevelt","download_url":"https://codeload.github.com/brenoroosevelt/php-array-functions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245844129,"owners_count":20681647,"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","at-least","at-most","dot-notation","dot-notation-array","functions","none","paginate","paginate-array","php","some"],"created_at":"2024-12-06T06:10:00.199Z","updated_at":"2025-03-27T12:28:43.439Z","avatar_url":"https://github.com/brenoroosevelt.png","language":"PHP","readme":"# PHP Array Functions\n\n[![CI Build](https://github.com/brenoroosevelt/php-array-functions/actions/workflows/ci.yml/badge.svg)](https://github.com/brenoroosevelt/php-array-functions/actions/workflows/ci.yml)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/brenoroosevelt/php-array-functions/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/brenoroosevelt/php-array-functions/?branch=main)\n[![codecov](https://codecov.io/gh/brenoroosevelt/php-array-functions/branch/main/graph/badge.svg?token=S1QBA18IBX)](https://codecov.io/gh/brenoroosevelt/php-array-functions)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](LICENSE.md)\n\nA set of helpful array/iterables functions.\n\n## Requirements\n\nThe following versions of PHP are supported: `7.4`, `8.0`, `8.1`.\n\n## Install\n\n```bash\n$ composer require brenoroosevelt/array-functions\n```\n\n## Available functions\n```php\n// Add - Set\nfunction add(array \u0026$set, ...$elements): int\nfunction set(array \u0026$set, $element, $key = null): void\n\n// Count\nfunction all(iterable $items, callable $callback, bool $empty_is_valid = true, int $mode = CALLBACK_USE_VALUE): bool\nfunction at_least(int $n, iterable $items, callable $callback, int $mode = CALLBACK_USE_VALUE): bool\nfunction at_most(int $n, iterable $items, callable $callback, int $mode = CALLBACK_USE_VALUE): bool\nfunction exactly(int $n, iterable $items, callable $callback, int $mode = CALLBACK_USE_VALUE): bool\nfunction none(iterable $items, callable $callback, int $mode = 0): bool\nfunction some(iterable $items, callable $callback, int $mode = CALLBACK_USE_VALUE): bool\nfunction contains(iterable $items, ...$elements): bool\n\n// Filter - Extract\nfunction accept(iterable $items, callable $callback, int $mode = CALLBACK_USE_VALUE): array\nfunction reject(iterable $items, callable $callback, int $mode = CALLBACK_USE_VALUE): array\nfunction only(array $items, ...$keys): array\nfunction except(array $items, ...$keys): array\nfunction first(iterable $items, callable $callback, $default = null, int $mode = CALLBACK_USE_VALUE)\n\n// Key - Index\nfunction has(array $haystack, $key, ...$keys): bool\nfunction index_of(iterable $haystack, $element, bool $strict = true)\n\n// Remove - Pull\nfunction pull(array \u0026$set, $key, $default = null)\nfunction remove(array \u0026$set, ...$elements): int\nfunction remove_key(array \u0026$set, $key, ...$keys): int\n\n// Miscellaneous\nfunction map(iterable $items, callable $callback, int $mode = CALLBACK_USE_VALUE): array\nfunction paginate(array $items, int $page, int $per_page, bool $preserve_keys = true): array\nfunction sum(iterable $items, callable $callback, int $mode = 0)\n\n// Dot Notation\nfunction flatten(array $items, ?string $pathSeparator = null): array\nfunction expand(array $items, string $separator = '.'): array\nfunction set_path(array \u0026$haystack, string $path, $value, string $separator = '.'): void\nfunction get_path(array $haystack, string $path, $default = null, string $separator = '.')\nfunction unset_path(array \u0026$haystack, string $path, string $separator = '.')\nfunction has_path(array $haystack, string $path, string $separator = '.'): bool\n\n// Pipeline\nfunction pipe($payload, callable ...$stages)\nfunction with(\u0026$value, callable ...$jobs)\n```\n## License\n\nThis project is licensed under the terms of the MIT license. See the [LICENSE](LICENSE.md) file for license rights and limitations.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrenoroosevelt%2Fphp-array-functions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrenoroosevelt%2Fphp-array-functions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrenoroosevelt%2Fphp-array-functions/lists"}