{"id":17477412,"url":"https://github.com/nabeghe/cally-php","last_synced_at":"2025-10-04T18:18:55.391Z","repository":{"id":258364316,"uuid":"874815891","full_name":"nabeghe/cally-php","owner":"nabeghe","description":"Just a handy helper for callables and calling them!","archived":false,"fork":false,"pushed_at":"2024-10-18T14:10:43.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-18T17:00:35.802Z","etag":null,"topics":["action","callable","callback","filter","invoke","php","phpfunction","phphelper","phpsupport","support"],"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/nabeghe.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-18T14:09:12.000Z","updated_at":"2024-10-18T14:12:05.000Z","dependencies_parsed_at":"2024-10-18T17:00:45.100Z","dependency_job_id":null,"html_url":"https://github.com/nabeghe/cally-php","commit_stats":null,"previous_names":["nabeghe/cally-php"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabeghe%2Fcally-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabeghe%2Fcally-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabeghe%2Fcally-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabeghe%2Fcally-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nabeghe","download_url":"https://codeload.github.com/nabeghe/cally-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248179727,"owners_count":21060687,"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":["action","callable","callback","filter","invoke","php","phpfunction","phphelper","phpsupport","support"],"created_at":"2024-10-18T20:07:59.270Z","updated_at":"2025-10-04T18:18:55.369Z","avatar_url":"https://github.com/nabeghe.png","language":"PHP","readme":"# Cally (Callable Helper for PHP)\n\n\u003e Just a handy helper for callables and calling them!\n\n\u003chr\u003e\n\n## 🫡 Usage\n\n### 🚀 Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require nabeghe/cally\n```\n\n\u003chr\u003e\n\n### Examples\n\n#### Example - call:\n\nAn alternative to `call_user_func_array` where you can create an array callable\nand place the arguments directly in the array.\n\n```php\nuse Nabeghe\\Cally\\Cally;\n\nclass Math\n{\n    public static function multiple($number1, $number2)\n    {\n        return $number1 * $number2;\n    }\n}\n\n$value = Cally::call([Math::class, 'multiple', 13], 14);\n\necho $value; // 182\n```\n\n#### Example - ob:\n\nExecute a callable between `ob_start`, `ob_get_contents`, \u0026 `ob_end_clean`, and returns the final buffer.\n\n```php\nuse Nabeghe\\Cally\\Cally;\n\n$output = Cally::ob(function () {\n    echo 'nabeghe/cally';\n});\n\necho $output; // nabeghe/cally\n```\n\n#### Example - action:\n\nInvokes a series of callbacks sequentially and in order.\n\n```php\nuse Nabeghe\\Cally\\Cally;\n\nCally::action([\n    function (\u0026$number) {\n        echo \"Action 1 = $number\\n\";\n        $number+=1;\n    },\n    function ($number) {\n        echo \"Action 2 = $number\\n\";\n    },\n], 13);\n\n// Action 1 = 13\n// Action 2 = 14\n```\n\n#### Example - filter:\n\nSequentially passes a value through a series of callbacks, updating it with each callback's output, and returns the final value.\n\n```php\nuse Nabeghe\\Cally\\Cally;\n\n$value = Cally::filter([\n    function ($value, $number) {\n        echo \"Filter 1 = $value\\n\";\n        $value+=$number;\n        return $value;\n    },\n    function ($value, $number) {\n        echo \"Filter 2 = $value\\n\";\n        $value*=$number;\n        return $value;\n    },\n], 13, 14);\n\necho \"Value    = $value\\n\";\n\n// Filter 1 = 13\n// Filter 2 = 27\n// Value    = 378\n```\n\n\u003chr\u003e\n\n## 📖 License\n\nLicensed under the MIT license, see [LICENSE.md](LICENSE.md) for details.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabeghe%2Fcally-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnabeghe%2Fcally-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabeghe%2Fcally-php/lists"}