{"id":13828293,"url":"https://github.com/Lambdish/phunctional","last_synced_at":"2025-07-09T06:31:27.131Z","repository":{"id":41165429,"uuid":"45692505","full_name":"Lambdish/phunctional","owner":"Lambdish","description":"⚡️ λ PHP functional library focused on simplicity and performance","archived":false,"fork":false,"pushed_at":"2023-09-25T08:59:46.000Z","size":198,"stargazers_count":358,"open_issues_count":2,"forks_count":39,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-06-16T18:45:05.321Z","etag":null,"topics":["functional","functional-programming","immutability","map","performance","php","php-library","reduce"],"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/Lambdish.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-06T16:13:18.000Z","updated_at":"2025-05-03T23:20:33.000Z","dependencies_parsed_at":"2022-07-25T21:30:06.866Z","dependency_job_id":"3a8eae05-ea43-444f-b8fd-e4b7ea4c597b","html_url":"https://github.com/Lambdish/phunctional","commit_stats":{"total_commits":115,"total_committers":19,"mean_commits":6.052631578947368,"dds":0.7130434782608696,"last_synced_commit":"3f17d1ee6072c63afa12ad5127d4b0662a9d8cee"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/Lambdish/phunctional","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lambdish%2Fphunctional","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lambdish%2Fphunctional/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lambdish%2Fphunctional/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lambdish%2Fphunctional/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lambdish","download_url":"https://codeload.github.com/Lambdish/phunctional/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lambdish%2Fphunctional/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260845807,"owners_count":23071683,"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":["functional","functional-programming","immutability","map","performance","php","php-library","reduce"],"created_at":"2024-08-04T09:02:40.043Z","updated_at":"2025-07-09T06:31:26.829Z","avatar_url":"https://github.com/Lambdish.png","language":"PHP","readme":"\u003cimg src=\"https://cloud.githubusercontent.com/assets/1331435/18451701/4888ff86-7938-11e6-8433-1fcaf668a625.jpg\" align=\"left\" width=\"192px\" height=\"192px\"/\u003e\n\u003cimg align=\"left\" width=\"0\" height=\"192px\" hspace=\"10\"/\u003e\n\n\u003e Phunctional, because functional programming matters. \n\n[![Lambdish](https://img.shields.io/badge/lambdish-phunctional-red.svg?style=flat-square)](https://github.com/Lambdish) [![MIT License](https://img.shields.io/badge/license-MIT-007EC7.svg?style=flat-square)](http://opensource.org/licenses/MIT) [![Version](https://img.shields.io/packagist/v/lambdish/phunctional.svg?style=flat-square)](https://github.com/Lambdish/phunctional/releases) [![Monthly Downloads](https://poser.pugx.org/lambdish/phunctional/d/monthly)](https://packagist.org/packages/lambdish/phunctional) [![Travis Build Status](http://img.shields.io/travis/Lambdish/phunctional.svg?style=flat-square)](https://travis-ci.org/Lambdish/phunctional)\n\nLambdish's Phunctional is a little library that tries to bring to PHP some aspects of functional programing with __util high order functions__ and __functions for manage iterables__.\n\n\u003cbr\u003e\n\n## About\n\nPhunctional is heavily inspired by [Clojure](https://clojure.org/) and some other PHP libraries like [iter](https://github.com/nikic/iter), [compose](https://github.com/igorw/compose) and [felpado](https://github.com/pablodip/felpado).\n\nThe main principles that we have in mind developing this library are:\n * A collection can be any iterable PHP object, arrays or generators\n * Favor composition vs inheritance\n * Be lazy when you can\n * Avoid state, state is (usually) evil!\n * Simplicity over easiness\n * Break the above rules if it makes sense\n\nAll of this can be resumed with a word: __Immutability__.\n\n## Installation\nTo install it with composer:\n```\ncomposer require lambdish/phunctional\n```\n\n## Simple usage\nThe first is to import every function you're going to use, for example:\n```php\nuse function Lambdish\\phunctional\\map;\n```\n\nAnd then you'll be able to use it:\n\n```php\nmap(\n    function ($number) {\n        return $number + 10;\n    },\n    [1, 2, 3, 4, 5]\n);\n\n// =\u003e [11, 12, 13, 14, 15]\n```\n\nAnd do something more complex like:\n```php\nuse function Lambdish\\Phunctional\\pipe;\nuse const Lambdish\\Phunctional\\{filter_null, reverse, first};\n\n$lastNonNullableValue = pipe(filter_null, reverse, first);\n\n$lastNonNullableValue(['first', null, 'other', 'last non nullable', null, null]);\n\n// =\u003e \"last non nullable\"\n```\nHere we're using the provided constants, that acts like an alias for the functions full qualified namespace\n(and therefore, are `callable`).\n\n## Documentation\nYou can find the functions documentation [here](docs/docs.md).\n","funding_links":[],"categories":["PHP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLambdish%2Fphunctional","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLambdish%2Fphunctional","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLambdish%2Fphunctional/lists"}