{"id":15561194,"url":"https://github.com/erenkucuker/powerful-php","last_synced_at":"2025-04-23T22:22:08.314Z","repository":{"id":56978762,"uuid":"376034228","full_name":"erenkucuker/powerful-php","owner":"erenkucuker","description":"⚡ Laravel Helpers, Collections and Js like object oriented chaining for Native PHP","archived":false,"fork":false,"pushed_at":"2021-06-15T18:00:02.000Z","size":3,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-06T04:06:47.422Z","etag":null,"topics":["helper-functions","laravel","laravel-framework","native-php","php","pipeline"],"latest_commit_sha":null,"homepage":"","language":null,"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/erenkucuker.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-06-11T13:28:31.000Z","updated_at":"2022-12-07T07:03:44.000Z","dependencies_parsed_at":"2022-08-21T08:10:57.818Z","dependency_job_id":null,"html_url":"https://github.com/erenkucuker/powerful-php","commit_stats":null,"previous_names":["erenkucukersoftware/powerful-php"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erenkucuker%2Fpowerful-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erenkucuker%2Fpowerful-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erenkucuker%2Fpowerful-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erenkucuker%2Fpowerful-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erenkucuker","download_url":"https://codeload.github.com/erenkucuker/powerful-php/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242254171,"owners_count":20097531,"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":["helper-functions","laravel","laravel-framework","native-php","php","pipeline"],"created_at":"2024-10-02T16:06:06.990Z","updated_at":"2025-03-06T17:31:46.947Z","avatar_url":"https://github.com/erenkucuker.png","language":null,"funding_links":["https://www.patreon.com/erenkucuker"],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eWelcome to Powerful PHP 🦾\u003c/h1\u003e\n\u003cp\u003e\n  \u003ca href=\"https://opensource.org/licenses/MIT\" target=\"_blank\"\u003e\n    \u003cimg alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://twitter.com/yerenkucuker\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Twitter: yerenkucuker\" src=\"https://img.shields.io/twitter/follow/yerenkucuker.svg?style=social\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003e ⚡ Laravel Helpers, Collections and Js like object oriented chaining for Native PHP \n\n## Install\n\n```sh\ncomposer require erenkucukersoftware/powerful-php\n```\n## 🚀 Usage\n\n### Object Oriented Chaining\n\n#### Example 1 :\n##### Functional Approach \n\n```php\n\n$snakeCase = strtolower(\n    preg_replace('/(.)(?=[A-Z])/u', '$1_', \n        preg_replace('/\\s+/u', '', \n            ucwords('HelloWorld')\n        )\n    )\n);\n             \nvar_dump($snakeCase); // \"hello_world\"\n```\n\n##### Object Oriented Approach \n\n```php\n//powerfulphp\n\n$snakeCase = \n    pipe('Hello World')\n    -\u003eucwords(_)\n    -\u003epreg_replace('/\\s+/u', '', _)\n    -\u003epreg_replace('/(.)(?=[A-Z])/u', '$1_', _)\n    -\u003estrtolower(_)\n    -\u003evar_dump;\n//\n// string(11) \"hello_world\"\n//\n```\n\n#### Example 2 :\n\n##### Passing Value Between Pipes\n\nTo pass a value as an argument to a function, use the underscore (_) character :\n```php\npipe('hello')\n    -\u003estr_replace('o', '', _)\n    -\u003evar_dump; // \"hell\"\n```\n\n#### Example 3 :\n\n##### One Parameter Usage\n\nYou can omit parentheses if only one argument is used:\n\n```php\npipe('some')\n    -\u003eis_array\n    -\u003edd; // bool(false) \n```\n\n#### Example 4 :\n\n##### Values\n\n\n```php\n$context = pipe('hello')-\u003estrtoupper;\n\nvar_dump($context);\n// object(Fun\\Pipe\\Pipe)#8 (1) { ... } \n\nvar_dump($context());\n// string(5) \"HELLO\"\n```\n\n#### Example 5 :\n\n##### Namespaces\n\nCalling single function from namespace\n```php\npipe()\n    -\u003euse('Some\\\\Namespace')-\u003efoo // Call \"\\Some\\Namespace\\foo()\"\n    -\u003efoo // Call \"\\foo()\"\n;\n\n```\n\nCalling multiple function from namespace\n```php\npipe()\n    -\u003euse('Some\\\\Namespace', fn($pipe) =\u003e \n        $pipe\n            -\u003ea // Call \"\\Some\\Namespace\\a()\"\n            -\u003eb // Call \"\\Some\\Namespace\\b()\"\n    )\n    -\u003ea // Call \"a()\"\n;\n\n```\n\n\n\n## Contributing\n\nContributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\n\n\n## Author\n\n👤 **Eren Küçüker**\n\n* Website: www.erenkucuker.com\n* Twitter: [@yerenkucuker](https://twitter.com/yerenkucuker)\n* Github: [@erenkucukersoftware](https://github.com/erenkucukersoftware)\n* LinkedIn: [@yunus-eren-küçüker-609716168](https://linkedin.com/in/yunus-eren-küçüker-609716168)\n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n\n\u003ca href=\"https://www.patreon.com/erenkucuker\"\u003e\n  \u003cimg src=\"https://c5.patreon.com/external/logo/become_a_patron_button@2x.png\" width=\"160\"\u003e\n\u003c/a\u003e\n\n## 📝 License\n\nCopyright © 2021 [Eren Küçüker](https://github.com/erenkucukersoftware).\u003cbr /\u003e\nThis project is [MIT](https://opensource.org/licenses/MIT) licensed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferenkucuker%2Fpowerful-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferenkucuker%2Fpowerful-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferenkucuker%2Fpowerful-php/lists"}