{"id":13759944,"url":"https://github.com/alwaysblank/rotary","last_synced_at":"2025-05-12T23:29:08.607Z","repository":{"id":56946516,"uuid":"198910073","full_name":"alwaysblank/rotary","owner":"alwaysblank","description":"Handle phone numbers.","archived":false,"fork":false,"pushed_at":"2021-10-01T17:35:28.000Z","size":33,"stargazers_count":9,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-28T02:47:53.060Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/alwaysblank.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":"2019-07-25T22:41:48.000Z","updated_at":"2021-10-01T17:35:28.000Z","dependencies_parsed_at":"2022-08-21T02:40:27.027Z","dependency_job_id":null,"html_url":"https://github.com/alwaysblank/rotary","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwaysblank%2Frotary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwaysblank%2Frotary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwaysblank%2Frotary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwaysblank%2Frotary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alwaysblank","download_url":"https://codeload.github.com/alwaysblank/rotary/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253839683,"owners_count":21972357,"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":[],"created_at":"2024-08-03T13:01:01.341Z","updated_at":"2025-05-12T23:29:08.570Z","avatar_url":"https://github.com/alwaysblank.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# Rotary ☎\r\n**Simplify working with phone numbers.**\r\n\r\n[![Build Status](https://travis-ci.org/alwaysblank/rotary.svg?branch=master)](https://travis-ci.org/alwaysblank/rotary)\r\n\r\n## Warning ⚠\r\n\r\nRotary will support numbers that look like the standard number format used in the United State of America, i.e. `nnn-nnnn` or `nnn nnn-nnnn`. These can also be prepended with an international country code up to 5 digit long, i.e. `nn nnn nnn-nnnn`. Numbers that deviate from this pattern cannot be reliably interpreted.\r\n\r\n## Usage 💪\r\n\r\nAlthough all the internal behaviors are easily accessible (with the exception of the `Number` class, all methods are available as static methods), in general, you'll just be using these methods from the `Render` class:\r\n\r\n- `pretty` will result in `(123) 456-7890` or `456-7890`.\r\n- `simple` will result in `123 456-7890` or `456-7890`.\r\n- `href` will result in `tel:+11234567890` or `tel:+14567890`.\r\n- `normalized` will result in `1234567890` or `567890`.\r\n\r\nYou can call them like this:\r\n\r\n```php\r\nuse AlwaysBlank\\Rotary\\Render;\r\n\r\necho Render::pretty('1234567890');\r\n// (123) 456-7890\r\n\r\necho Render::pretty('123 456 7890');\r\n// (123) 456-7890\r\n\r\necho Render::pretty('[123)    456/7890');\r\n// (123) 456-7890\r\n```\r\n\r\nYou can also instantiate a `Rotary` object, which has methods for the different format types:\r\n\r\n```php\r\nuse AlwaysBlank\\Rotary\\Rotary;\r\n\r\n$Rotary = new Rotary('123456789');\r\necho $Rotary-\u003epretty();\r\n// (123) 456-7890\r\n```\r\n\r\nThis can be useful if you want access to several formats on one number.\r\n\r\n\u003e You can put any non-digit characters you like in your argument and Rotary will simply ignore them--it cares only for digits. `234-5678` and `2dfsad__34-5)(6=78` are identical so far as it's concerned.\r\n\r\n**Note:** Rotary will try to interpret strange arguments, but it has limits, so please try to pass it numbers that make sense. 🙏\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falwaysblank%2Frotary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falwaysblank%2Frotary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falwaysblank%2Frotary/lists"}