{"id":27994452,"url":"https://github.com/chevere/message","last_synced_at":"2025-05-08T19:12:11.167Z","repository":{"id":210090628,"uuid":"725720202","full_name":"chevere/message","owner":"chevere","description":"Strings with template tags support","archived":false,"fork":false,"pushed_at":"2025-03-06T20:45:48.000Z","size":68,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"1.0","last_synced_at":"2025-05-08T19:12:05.139Z","etag":null,"topics":["chevere","php","php-library"],"latest_commit_sha":null,"homepage":"https://chevere.org/packages/message","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chevere.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2023-11-30T18:25:33.000Z","updated_at":"2025-03-06T20:45:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"0ddfe28e-63b7-40ef-9f48-d6aa299ec0a3","html_url":"https://github.com/chevere/message","commit_stats":null,"previous_names":["chevere/message"],"tags_count":2,"template":false,"template_full_name":"chevere/package-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chevere%2Fmessage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chevere%2Fmessage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chevere%2Fmessage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chevere%2Fmessage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chevere","download_url":"https://codeload.github.com/chevere/message/tar.gz/refs/heads/1.0","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253133115,"owners_count":21859112,"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":["chevere","php","php-library"],"created_at":"2025-05-08T19:12:10.617Z","updated_at":"2025-05-08T19:12:11.149Z","avatar_url":"https://github.com/chevere.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Message\n\n![Chevere](chevere.svg)\n\n[![Build](https://img.shields.io/github/actions/workflow/status/chevere/message/test.yml?branch=1.0\u0026style=flat-square)](https://github.com/chevere/message/actions)\n![Code size](https://img.shields.io/github/languages/code-size/chevere/message?style=flat-square)\n[![Apache-2.0](https://img.shields.io/github/license/chevere/message?style=flat-square)](LICENSE)\n[![PHPStan](https://img.shields.io/badge/PHPStan-level%209-blueviolet?style=flat-square)](https://phpstan.org/)\n[![Mutation testing badge](https://img.shields.io/endpoint?style=flat-square\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fchevere%2Fmessage%2F1.0)](https://dashboard.stryker-mutator.io/reports/github.com/chevere/message/1.0)\n\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=chevere_message\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=chevere_message)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=chevere_message\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=chevere_message)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=chevere_message\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=chevere_message)\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=chevere_message\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=chevere_message)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=chevere_message\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=chevere_message)\n[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=chevere_message\u0026metric=sqale_index)](https://sonarcloud.io/dashboard?id=chevere_message)\n[![CodeFactor](https://www.codefactor.io/repository/github/chevere/message/badge)](https://www.codefactor.io/repository/github/chevere/message)\n\n## Summary\n\nMessage enables to create strings with template tags support.\n\n## Installing\n\nMessage is available through [Packagist](https://packagist.org/packages/chevere/message) and the repository source is at [chevere/message](https://github.com/chevere/message).\n\n```sh\ncomposer require chevere/message\n```\n\n## Creating a Message\n\nUse function `message` to create a Message by passing the message template. Use named named arguments to define replacement pairs.\n\n```php\nuse function Chevere\\Message\\message;\n\n$message = message(\n    'Hello, **%tag%**!',\n    tag: 'World'\n);\n```\n\n🪄 Message supports `%tag%`, `{{tag}}` and `{{ tag }}` replacement template tags.\n\n## To string\n\nThe `__toString` method return the message with translated placeholders.\n\n```php\n$message-\u003e__toString();\n// Hello, **World**!\n```\n\n## Utility methods\n\n### Template\n\nUse `template` method to return the message template.\n\n```php\n$message-\u003ereplacements();\n// Hello, **%tag%**!\n```\n\n### Replacements\n\nUse `replacements` method to read message replacement pairs.\n\n```php\n$message-\u003ereplacements();\n// ['tag' =\u003e 'World']\n```\n\n## Documentation\n\nDocumentation is available at [chevere.org](https://chevere.org/packages/message).\n\n## License\n\nCopyright [Rodolfo Berrios A.](https://rodolfoberrios.com/)\n\nChevere is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full license text.\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchevere%2Fmessage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchevere%2Fmessage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchevere%2Fmessage/lists"}