{"id":15296292,"url":"https://github.com/andydune/arraywalker","last_synced_at":"2026-01-05T22:35:48.100Z","repository":{"id":56948200,"uuid":"133907818","full_name":"AndyDune/ArrayWalker","owner":"AndyDune","description":"Better implementation foreach operator with nested array compability.","archived":false,"fork":false,"pushed_at":"2020-05-03T18:25:33.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T05:43:31.995Z","etag":null,"topics":["array","array-manipulations","php","php7"],"latest_commit_sha":null,"homepage":null,"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/AndyDune.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-18T05:37:13.000Z","updated_at":"2020-05-03T18:25:35.000Z","dependencies_parsed_at":"2022-08-21T03:10:17.461Z","dependency_job_id":null,"html_url":"https://github.com/AndyDune/ArrayWalker","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/AndyDune%2FArrayWalker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndyDune%2FArrayWalker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndyDune%2FArrayWalker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndyDune%2FArrayWalker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndyDune","download_url":"https://codeload.github.com/AndyDune/ArrayWalker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245407755,"owners_count":20610232,"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","array-manipulations","php","php7"],"created_at":"2024-09-30T18:09:58.809Z","updated_at":"2026-01-05T22:35:48.045Z","avatar_url":"https://github.com/AndyDune.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ArrayWalker\n\n[![Build Status](https://travis-ci.org/AndyDune/ArrayWalker.svg?branch=master)](https://travis-ci.org/AndyDune/ArrayWalker)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)\n[![Packagist Version](https://img.shields.io/packagist/v/andydune/array-walker.svg?style=flat-square)](https://packagist.org/packages/andydune/array-walker)\n[![Total Downloads](https://img.shields.io/packagist/dt/andydune/array-walker.svg?style=flat-square)](https://packagist.org/packages/andydune/array-walker)\n\n\nBetter implementation foreach operator with nested array compability.\n\n\nInstallation\n------------\n\nInstallation using composer:\n\n```\ncomposer require andydune/array-walker\n```\nOr if composer was not installed globally:\n```\nphp composer.phar require andydune/array-walker\n```\nOr edit your `composer.json`:\n```\n\"require\" : {\n     \"andydune/array-walker\": \"^1\"\n}\n\n```\nAnd execute command:\n```\nphp composer.phar update\n```\n\nExample\n------------\n\n```php\nuse AndyDune\\ArrayWalker\\ArrayWalker;\nuse AndyDune\\ArrayWalker\\ItemContainer;\n\n// Source array\n$array = [\n    'one' =\u003e 1,\n    'two' =\u003e 2,\n    'three' =\u003e 3,\n];\n\n$arrayWalker = new ArrayWalker($array);\n// Change values\n$arrayWalker-\u003eaddFunction(function (ItemContainer $item) {\n    $item-\u003esetValue($item-\u003egetValue() + 10);\n});\n$result = $arrayWalker-\u003eapply();\n$result = [\n    'one' =\u003e 11,\n    'two' =\u003e 12,\n    'three' =\u003e 13,\n];\n\n$arrayWalker = new ArrayWalker($array);\n// Change keys\n$arrayWalker-\u003eaddFunction(function (ItemContainer $item) {\n   $item-\u003esetKey(strtoupper($item-\u003egetKey()));\n});\n$result = $arrayWalker-\u003eapply();\n$result = [\n    'ONE' =\u003e 1,\n    'TWO' =\u003e 2,\n    'THREE' =\u003e 3,\n];\n\n$arrayWalker = new ArrayWalker($array);\n// Delete value \n$arrayWalker = new ArrayWalker($array);\n$arrayWalker-\u003eaddFunction(function (ItemContainer $item) {\n    $item-\u003esetValue($item-\u003egetValue() + 10);\n    if ($item-\u003egetKey() == 'one') {\n        $item-\u003edelete();\n    }\n});\n$result = $arrayWalker-\u003eapply();\n\n$result = [\n    'two' =\u003e 12,\n    'three' =\u003e 13,\n];\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandydune%2Farraywalker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandydune%2Farraywalker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandydune%2Farraywalker/lists"}