{"id":26233619,"url":"https://github.com/tamtamchik/namecase","last_synced_at":"2025-04-06T09:09:30.132Z","repository":{"id":3683131,"uuid":"50532821","full_name":"tamtamchik/namecase","owner":"tamtamchik","description":"PHP package that converts names into the correct case where it is possible.","archived":false,"fork":false,"pushed_at":"2024-08-06T15:25:18.000Z","size":104,"stargazers_count":77,"open_issues_count":5,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-30T07:11:44.589Z","etag":null,"topics":["composer-package","framework-agnostic","namecase","php"],"latest_commit_sha":null,"homepage":"https://tamtamchika.net/namecase","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/tamtamchik.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2016-01-27T19:41:22.000Z","updated_at":"2024-08-28T11:20:13.000Z","dependencies_parsed_at":"2024-02-23T22:30:08.827Z","dependency_job_id":"8fbb4268-d696-49d3-b871-ff693b891316","html_url":"https://github.com/tamtamchik/namecase","commit_stats":{"total_commits":105,"total_committers":6,"mean_commits":17.5,"dds":0.07619047619047614,"last_synced_commit":"f963f321a3afbde83f1bb1bda1d53b848c7015dd"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamtamchik%2Fnamecase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamtamchik%2Fnamecase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamtamchik%2Fnamecase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamtamchik%2Fnamecase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tamtamchik","download_url":"https://codeload.github.com/tamtamchik/namecase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247457803,"owners_count":20941906,"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":["composer-package","framework-agnostic","namecase","php"],"created_at":"2025-03-13T01:16:42.490Z","updated_at":"2025-04-06T09:09:30.112Z","avatar_url":"https://github.com/tamtamchik.png","language":"PHP","readme":"# NameCase\n\n[![Latest Version on Packagist][ico-version]][link-packagist]\n![PHP][ico-php]\n[![Total Downloads][ico-downloads]][link-downloads]\n[![Software License][ico-license]](LICENSE.md)\n[![Build Status][ico-scrutinizer-build]][link-scrutinizer]\n[![Coverage Status][ico-scrutinizer]][link-scrutinizer]\n[![Quality Score][ico-code-quality]][link-code-quality]\n\n[![SensioLabsInsight][ico-insight]][link-insight]\n\nForenames and surnames are often stored either entirely in UPPERCASE or lowercase. This package allows you to convert\nnames into the correct case where possible. Although forenames and surnames are typically stored separately if they \nappear in a single string, whitespace-separated, NameCase deals correctly with them.\n\nCurrently, NameCase correctly name-cases names which include any of the following:\n\n```\nMc, Mac, al, el, ap, bat, ben, bin, binti, binte, da, de, das, dos, delle, della, di, du, del, der, den, ten, ter, la, le, lo, van and von.\n```\n\nIt correctly deals with names that contain apostrophes and hyphens, too.\n\n\u003e [!NOTE]\n\u003e This README.md is for version 3.x.  \n\u003e If you need a PHP 5 compatible version, please use\n\u003e 1.0.x! [README.md](https://github.com/tamtamchik/namecase/blob/1.0.x/README.md#namecase)\n\n## Install\n\nVia Composer\n\n```bash\n$ composer require tamtamchik/namecase\n```\n\n## Usage\n\n```php\nuse \\Tamtamchik\\NameCase\\Formatter;\nuse function \\Tamtamchik\\NameCase\\str_name_case;\n\n// As a static call\nFormatter::nameCase(\"KEITH\");                            // =\u003e Keith\nFormatter::nameCase(\"LEIGH-WILLIAMS\");                   // =\u003e Leigh-Williams\nFormatter::nameCase(\"MCCARTHY\");                         // =\u003e McCarthy\nFormatter::nameCase(\"O'CALLAGHAN\");                      // =\u003e O'Callaghan\nFormatter::nameCase(\"ST. JOHN\");                         // =\u003e St. John\nFormatter::nameCase(\"VON STREIT\");                       // =\u003e von Streit\nFormatter::nameCase(\"AP LLWYD DAFYDD\");                  // =\u003e ap Llwyd Dafydd\nFormatter::nameCase(\"HENRY VIII\");                       // =\u003e Henry VIII\nFormatter::nameCase(\"VAN DYKE\");                         // =\u003e van Dyke\n\n// Or as an instance\n$formatter = new Formatter();\n$formatter-\u003enameCase(\"LOUIS XIV\");                       // =\u003e Louis XIV\n\n// Or as a function\nstr_name_case(\"JJ ABRAMS\");                              // =\u003e JJ Abrams\n\n// Passing options (see below for details)\nFormatter::setOptions([\n  'lazy'        =\u003e true,\n  'irish'       =\u003e true,\n  'spanish'     =\u003e false,\n  'roman'       =\u003e true,\n  'hebrew'      =\u003e true,\n  'postnominal' =\u003e true,\n]);\n\n// Or\n$formatter = new Formatter(['spanish' =\u003e true]);\n\n// Or \n$formatter-\u003esetOptions([\n    'lazy' = false, \n    'postnominal' =\u003e false\n]);\n\n// Or even\nFormatter::nameCase(\"VAN DYKE\", ['lazy' = false]);\n\n// And for function\nstr_name_case(\"VAN DYKE\", ['lazy' = false]);\n```\n\n## Options\n\n* `lazy` – Default: `true`. Do not do anything if the string is already mixed case and the lazy option is `true`.\n* `irish` – Default: `true`. Correct \"Mac\" exceptions.\n* `spanish` – Default: `false`. Correct `el, la` and Spanish conjunctions.\n* `roman` – Default: `true`. Correct Roman numbers.\n* `hebrew` – Default: `true`. Correct `ben, bat`.\n* `postnominal` – Default: `true`. Correct post-nominal e.g. `PhD`.\n\n## Exclude Post-Nominals\n\n```php\n\u003c?php\n\nuse Tamtamchik\\NameCase\\Formatter;\n\nFormatter::excludePostNominals('MOst');\n\nFormatter::nameCase('ČERNÝ MOST');\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Testing \u0026 Demo\n\n```bash\n$ composer tests\n$ composer demo\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) and [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) for details.\n\n## Security\n\nIf you discover any security-related issues, please email \u003cyuri.tam.tkachenko@gmail.com\u003e instead of using the issue\ntracker.\n\n## Acknowledgements\n\nThis library is a port of the [Perl library](https://metacpan.org/release/BARBIE/Lingua-EN-NameCase-1.19) and owes most\nof its functionality to the Perl version by Mark Summerfield.  \nI also used some solutions from [Ruby version](https://github.com/tenderlove/namecase) by Aaron Patterson.  \nAny bugs in the PHP port are my fault.\n\n## Credits\n\nOriginal PERL `Lingua::EN::NameCase` Version:\n\n- Copyright \u0026copy; Mark Summerfield 1998-2014. All Rights Reserved.\n- Copyright \u0026copy; Barbie 2014-2019. All Rights Reserved.\n\nRuby Version:\n\n- Copyright \u0026copy; Aaron Patterson 2006. All Rights Reserved.\n\nPHP Version:\n\n- [Yuri Tkachenko][link-author]\n- [All Contributors][link-contributors]\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n---\n\n[![Buy Me A Coffee][ico-coffee]][link-coffee]\n\n[ico-version]: https://img.shields.io/packagist/v/tamtamchik/namecase.svg?style=flat-square\n[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n[ico-scrutinizer-build]: https://img.shields.io/scrutinizer/build/g/tamtamchik/namecase.svg?style=flat-square\n[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/tamtamchik/namecase.svg?style=flat-square\n[ico-code-quality]: https://img.shields.io/scrutinizer/g/tamtamchik/namecase.svg?style=flat-square\n[ico-downloads]: https://img.shields.io/packagist/dt/tamtamchik/namecase.svg?style=flat-square\n[ico-coffee]: https://img.shields.io/badge/Buy%20Me%20A-Coffee-%236F4E37.svg?style=flat-square\n[ico-insight]: https://insight.symfony.com/projects/29bec8f4-aeb0-4a62-9c2e-2d93a0a71bcc/small.svg\n[ico-php]: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Ftamtamchik%2Fnamecase%2Fraw%2Fmaster%2Fcomposer.json\u0026query=%24.require.php\u0026style=flat-square\u0026label=PHP\n\n[link-packagist]: https://packagist.org/packages/tamtamchik/namecase\n[link-travis]: https://app.travis-ci.com/github/tamtamchik/namecase\n[link-scrutinizer]: https://scrutinizer-ci.com/g/tamtamchik/namecase/code-structure\n[link-code-quality]: https://scrutinizer-ci.com/g/tamtamchik/namecase\n[link-downloads]: https://packagist.org/packages/tamtamchik/namecase\n[link-author]: https://github.com/tamtamchik\n[link-contributors]: ../../contributors\n[link-coffee]: https://www.buymeacoffee.com/tamtamchik\n[link-insight]: https://insight.symfony.com/projects/29bec8f4-aeb0-4a62-9c2e-2d93a0a71bcc\n","funding_links":["https://www.buymeacoffee.com/tamtamchik"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftamtamchik%2Fnamecase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftamtamchik%2Fnamecase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftamtamchik%2Fnamecase/lists"}