{"id":15307253,"url":"https://github.com/samsonasik/naming","last_synced_at":"2026-02-03T06:05:19.485Z","repository":{"id":46774076,"uuid":"172080677","full_name":"samsonasik/Naming","owner":"samsonasik","description":"Filter and Validator for people name with multibyte string check support","archived":false,"fork":false,"pushed_at":"2024-09-08T17:02:23.000Z","size":69,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T12:37:45.547Z","etag":null,"topics":["filter","laminas","mbstring","multibyte","name","naming","people","php","special","standalone","validator","zf","zf2","zf3"],"latest_commit_sha":null,"homepage":null,"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/samsonasik.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}},"created_at":"2019-02-22T14:32:43.000Z","updated_at":"2024-09-08T17:02:26.000Z","dependencies_parsed_at":"2023-02-09T23:45:30.166Z","dependency_job_id":null,"html_url":"https://github.com/samsonasik/Naming","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samsonasik%2FNaming","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samsonasik%2FNaming/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samsonasik%2FNaming/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samsonasik%2FNaming/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samsonasik","download_url":"https://codeload.github.com/samsonasik/Naming/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248984239,"owners_count":21193713,"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":["filter","laminas","mbstring","multibyte","name","naming","people","php","special","standalone","validator","zf","zf2","zf3"],"created_at":"2024-10-01T08:09:37.810Z","updated_at":"2026-02-03T06:05:19.441Z","avatar_url":"https://github.com/samsonasik.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Naming\n======\n\n[![Latest Version](https://img.shields.io/github/release/samsonasik/Naming.svg?style=flat-square)](https://github.com/samsonasik/Naming/releases)\n![ci build](https://github.com/samsonasik/Naming/workflows/ci%20build/badge.svg)\n[![Code Coverage](https://codecov.io/gh/samsonasik/Naming/branch/master/graph/badge.svg)](https://codecov.io/gh/samsonasik/Naming)\n[![PHPStan](https://img.shields.io/badge/style-level%20max-brightgreen.svg?style=flat-square\u0026label=phpstan)](https://github.com/phpstan/phpstan)\n[![Downloads](https://img.shields.io/packagist/dt/samsonasik/naming.svg?style=flat-square)](https://packagist.org/packages/samsonasik/naming)\n\nNaming is a library that has filter and validator for people name with multibyte string check support, extends the [`Laminas`](https://getlaminas.org/) filter and validator, while it can be used as standalone.\n\nInstallation\n------------\n\n```sh\ncomposer require samsonasik/naming\n```\n\nFilter Flow\n-----------\n\n- Strip Tags\n- String Trim\n- String To Upper first letter in each word with set lower case after that\n- Replace double space to single space\n- String To Upper after `'` and `-` character if any\n\nExamples:\n\n| Original name                    | Filtered name\n|----------------------------------|-----------------\n| \\\u003cscript\u003eAbdul                    | Abdul\n| ABduL                            | Abdul\n| aBDUL m. ikHsan                  | Abdul M. Ikhsan\n| abdul Malik\u0026nbsp;\u0026nbsp;\u0026nbsp;I   | Abdul Malik I\n| D'lilah                          | D'Lilah\n| Veli-matti                       | Veli-Matti\n| äX                               | Äx\n\nValidation checks\n-----------------\n\n- Allowed characters: letters, hyphens, apostrophe, spaces, full stops.\n- Not allowed:\n   - include number\n   - special characters\n   - single `.` character\n   - single `-` character\n   - single `'` character\n   - consecutive `.` characters\n   - consecutive `-` characters\n   - consecutive `'` characters\n   - full stops not in the last of each word\n\nUsage with laminas-form instance:\n\n```php\nuse Naming\\Filter;\nuse Naming\\Validator;\nuse Laminas\\Form\\Element\\Text;\nuse Laminas\\Form\\Form;\nuse Laminas\\InputFilter\\InputFilterProviderInterface;\n\nclass ContactForm extends Form implements InputFilterProviderInterface\n{\n    public function init()\n    {\n        $this-\u003eadd([\n            'type' =\u003e Text::class,\n            'name' =\u003e 'fullname',\n            'options' =\u003e [\n                'label' =\u003e 'Full name',\n            ],\n        ]);\n    }\n\n    public function getInputFilterSpecification()\n    {\n        return [\n            [\n                'name'     =\u003e 'fullname',\n                'required' =\u003e true,\n                'filters' =\u003e [\n                    [\n                        'name' =\u003e Filter\\Naming::class\n                    ],\n                ],\n                'validators' =\u003e [\n                    [\n                        'name' =\u003e Validator\\Naming::class,\n                    ],\n                ],\n            ],\n        ];\n    }\n}\n```\n\nUsing standalone:\n\n```php\nuse Naming\\Filter;\nuse Naming\\Validator;\n\ninclude 'vendor/autoload.php';\n\n// ... VALID\n$filtered = (new Filter\\Naming())-\u003efilter('Abdul malik ikhsan');\n$validator = new Validator\\Naming();\n\necho $filtered; // Abdul Malik Ikhsan\nvar_dump($validator-\u003eisValid($filtered)); // true\n\n// ... INVALID\n$filtered = (new Filter\\Naming())-\u003efilter('Abdul....');\n$validator = new Validator\\Naming();\n\necho $filtered; // Abdul....\nvar_dump($validator-\u003eisValid($filtered)); // false\nvar_dump(\\current($validator-\u003egetMessages())); /* \"Consecutive \".\"s are not allowed\" */\n```\n\nContributing\n------------\nContributions are very welcome. Please read [CONTRIBUTING.md](https://github.com/samsonasik/Naming/blob/master/CONTRIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamsonasik%2Fnaming","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamsonasik%2Fnaming","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamsonasik%2Fnaming/lists"}