{"id":39552953,"url":"https://github.com/respect/stringformatter","last_synced_at":"2026-02-09T14:09:49.710Z","repository":{"id":332865114,"uuid":"1135294869","full_name":"Respect/StringFormatter","owner":"Respect","description":"A powerful and flexible PHP library for formatting and transforming strings.","archived":false,"fork":false,"pushed_at":"2026-02-02T02:58:46.000Z","size":120,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-02T12:35:29.643Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Respect.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-01-15T22:44:36.000Z","updated_at":"2026-02-02T02:58:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Respect/StringFormatter","commit_stats":null,"previous_names":["respect/masker","respect/stringformatter"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/Respect/StringFormatter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Respect%2FStringFormatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Respect%2FStringFormatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Respect%2FStringFormatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Respect%2FStringFormatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Respect","download_url":"https://codeload.github.com/Respect/StringFormatter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Respect%2FStringFormatter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29193089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T07:37:03.739Z","status":"ssl_error","status_checked_at":"2026-02-07T07:37:03.029Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-01-18T06:58:24.987Z","updated_at":"2026-02-07T11:00:43.637Z","avatar_url":"https://github.com/Respect.png","language":"PHP","readme":"\u003c!--\nSPDX-FileCopyrightText: (c) Respect Project Contributors\nSPDX-License-Identifier: ISC\nSPDX-FileContributor: Henrique Moody \u003chenriquemoody@gmail.com\u003e\nSPDX-FileContributor: Alexandre Gomes Gaigalas \u003calganet@gmail.com\u003e\n--\u003e\n\n# Respect\\StringFormatter\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/Respect/StringFormatter/continuous-integration.yml?branch=main\u0026style=flat-square)](https://github.com/Respect/StringFormatter/actions/workflows/continuous-integration.yml)\n[![Code Coverage](https://img.shields.io/codecov/c/github/Respect/StringFormatter?style=flat-square)](https://codecov.io/gh/Respect/StringFormatter)\n[![Latest Stable Version](https://img.shields.io/packagist/v/respect/string-formatter.svg?style=flat-square)](https://packagist.org/packages/respect/string-formatter)\n[![Total Downloads](https://img.shields.io/packagist/dt/respect/string-formatter.svg?style=flat-square)](https://packagist.org/packages/respect/string-formatter)\n[![License](https://img.shields.io/packagist/l/respect/string-formatter.svg?style=flat-square)](https://packagist.org/packages/respect/string-formatter)\n\nA powerful and flexible PHP library for formatting and transforming strings.\n\n## Installation\n\n```bash\ncomposer require respect/string-formatter\n```\n\n## Usage\n\nYou can use individual formatters directly or chain multiple formatters together using the `FormatterBuilder`:\n\n```php\nuse Respect\\StringFormatter\\FormatterBuilder as f;\n\necho f::create()\n    -\u003emask('7-12')\n    -\u003epattern('#### #### #### ####')\n    -\u003eformat('1234123412341234');\n// Output: 1234 12** **** 1234\n```\n\n### Using Formatters as Modifiers\n\nThe `PlaceholderFormatter` allows you to use any formatter as a modifier within templates:\n\n```php\nuse Respect\\StringFormatter\\PlaceholderFormatter;\n\n$formatter = new PlaceholderFormatter([\n    'date' =\u003e '2024-01-15',\n    'amount' =\u003e '1234.56',\n    'phone' =\u003e '1234567890',\n]);\n\necho $formatter-\u003eformat('Date: {{date|date:Y/m/d}}, Amount: ${{amount|number:2}}, Phone: {{phone|pattern:(###) ###-####}}');\n// Output: Date: 2024/01/15, Amount: $1,234.56, Phone: (123) 456-7890\n```\n\nSee the [PlaceholderFormatter documentation](docs/PlaceholderFormatter.md) and [FormatterModifier documentation](docs/modifiers/FormatterModifier.md) for more details.\n\n## Formatters\n\n| Formatter                                                  | Description                                                      |\n| ---------------------------------------------------------- | ---------------------------------------------------------------- |\n| [AreaFormatter](docs/AreaFormatter.md)                     | Metric area promotion (mm², cm², m², a, ha, km²)                 |\n| [DateFormatter](docs/DateFormatter.md)                     | Date and time formatting with flexible parsing                   |\n| [ImperialAreaFormatter](docs/ImperialAreaFormatter.md)     | Imperial area promotion (in², ft², yd², ac, mi²)                 |\n| [ImperialLengthFormatter](docs/ImperialLengthFormatter.md) | Imperial length promotion (in, ft, yd, mi)                       |\n| [ImperialMassFormatter](docs/ImperialMassFormatter.md)     | Imperial mass promotion (oz, lb, st, ton)                        |\n| [MaskFormatter](docs/MaskFormatter.md)                     | Range-based string masking with Unicode support                  |\n| [MassFormatter](docs/MassFormatter.md)                     | Metric mass promotion (mg, g, kg, t)                             |\n| [MetricFormatter](docs/MetricFormatter.md)                 | Metric length promotion (mm, cm, m, km)                          |\n| [NumberFormatter](docs/NumberFormatter.md)                 | Number formatting with thousands and decimal separators          |\n| [PatternFormatter](docs/PatternFormatter.md)               | Pattern-based string filtering with placeholders                 |\n| [PlaceholderFormatter](docs/PlaceholderFormatter.md)       | Template interpolation with placeholder replacement              |\n| [TimeFormatter](docs/TimeFormatter.md)                     | Time promotion (mil, c, dec, y, mo, w, d, h, min, s, ms, us, ns) |\n\n## Contributing\n\nPlease see our [Contributing Guide](CONTRIBUTING.md) for information on how to contribute to this project.\n\n## License\n\nThis project is licensed under the ISC License - see the LICENSE file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frespect%2Fstringformatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frespect%2Fstringformatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frespect%2Fstringformatter/lists"}