{"id":13828573,"url":"https://github.com/nkkollaw/zubr","last_synced_at":"2025-04-09T20:04:36.449Z","repository":{"id":69267731,"uuid":"98787825","full_name":"nkkollaw/zubr","owner":"nkkollaw","description":"Wrapper library to fix inconsistencies in PHP's core functions","archived":false,"fork":false,"pushed_at":"2018-03-31T21:49:30.000Z","size":152,"stargazers_count":99,"open_issues_count":78,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-09T20:04:28.536Z","etag":null,"topics":["conventions","functions-beautifier","php","php-7","php-functions","php-library","wrapper"],"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/nkkollaw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2017-07-30T09:33:22.000Z","updated_at":"2023-11-20T15:40:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"44912c2c-4b54-44fe-aa19-75bb5a2fb746","html_url":"https://github.com/nkkollaw/zubr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkkollaw%2Fzubr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkkollaw%2Fzubr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkkollaw%2Fzubr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkkollaw%2Fzubr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nkkollaw","download_url":"https://codeload.github.com/nkkollaw/zubr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103868,"owners_count":21048245,"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":["conventions","functions-beautifier","php","php-7","php-functions","php-library","wrapper"],"created_at":"2024-08-04T09:02:52.981Z","updated_at":"2025-04-09T20:04:36.427Z","avatar_url":"https://github.com/nkkollaw.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"![](http://i.imgur.com/oWdNDv2.png)\n\n# Zubr\n\n## Wrapper library to fix inconsistencies in PHP's core functions\n\nPHP is great and Composer, PHP-FIG, and all the different frameworks make it even greater. However, there is still legacy stuff in the language itself that makes PHP harder to use than it should be (see http://phpsadness.com/ for one of many lists).\n\nZubr is a wrapper library to fix inconsistencies in PHP's core functions. It wraps PHP's built-in functions and attempts to fix a few things—starting with consistent naming, order of arguments, and more.\n\nFor instance, from:\n\n    parse_url()\n    urlencode()\n    \nto:\n\n    \\Zubr\\parse_url()\n    \\Zubr\\url_encode()\n    \nand even:\n\n    htmlentities()\n    html_entity_decode()\n    \nto:\n\n    \\Zubr\\html_entity_encode() // alias to htmlentities(), \\Zubr\\html_entities()\n    \\Zubr\\html_entity_decode()\n    \nFunctions always have the same name as the built-in ones, but they follow the same set of rules. Zubr is intuitive to use, because function names are predictable and similar to the ones you're used to. \n\nZubr's idea came from commenting this HN post: https://news.ycombinator.com/item?id=14883784\n    \n# Rules\n\n## 0. Introduction\n\nWe're ignoring PHP \u003c 7.0.0. Any function that is deprecated and not included in PHP 7.0.0 won't be found in Zubr.\n    \n## 1. Function naming\n\n### 1.1 Underscores\n\nSee: http://phpsadness.com/sad/4\n\nWe always use snake_case.\n\n### 1.2 Prefixes\n\nSee: http://phpsadness.com/sad/15\n\nWe add aliases using `micro` instead of `u` (which sometimes means `user`).\n\nWe add aliases using `user` instead of `u` (which sometimes means `micro`).\n\n### 1.3 `to` vs. `2`\n\nSee: http://phpsadness.com/sad/48\n\nWe add aliases using `to` instead of `2`.\n\n## 2. Order of arguments\n\n### 2.1 Needle/haystack\n\nSee: http://phpsadness.com/sad/9 and similar.\n\nWe always put the subject first, then the keyword (`$haystack` first, then `$needle`).\n\nFor example, you'd say \"search *Google* for *dog*\" (which means \"search `$subject` for `$keyword`\").\n\nMost PHP functions already follow this convention.\n\n### 2.2 Callbacks\n\nSee: http://phpsadness.com/sad/6\n\nWe always put the callback last.\n\n## 3. Argument type\n\n\u003e Note: If the parameters given to a function are not what it expects, such as passing an array where a string is expected, the return value of the function is undefined. In this case it will likely return NULL but this is just a convention, and cannot be relied upon. http://php.net/manual/en/functions.internal.php\n\nWe'd like to fix the above in \u003e 1.0 releases.\n\n# Roadmap\n\nVersion 1.0 will contain all of PHP's [core built-in functions](http://php.net/manual/en/extensions.membership.php#extensions.membership.core).\n\nWe might then go on to implement a private plugin system to add [bundled extensions](http://php.net/manual/en/extensions.membership.php#extensions.membership.bundled) in 2.0, and make the plugin system public so that anyone can implement wrappers to [external extensions](http://php.net/manual/en/extensions.membership.php#extensions.membership.external) in version 3.0.\n\nWe have detailed milestones with all features that will be implemented up to version 1.0 at https://github.com/nkkollaw/zubr/milestones.\n\n# Contribute\n\nPull requests are welcome.\n\nTake a look at the CONTRIBUTING.md file. \n    \n## Contact us\n\nEmails can be found in the `composer.json` file.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnkkollaw%2Fzubr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnkkollaw%2Fzubr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnkkollaw%2Fzubr/lists"}