Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jaxwilko/human-name-processor

Simple name processing in php
https://github.com/jaxwilko/human-name-processor

Last synced: about 1 month ago
JSON representation

Simple name processing in php

Awesome Lists containing this project

README

        

# Human Name Processor

This package aims to provide quick and easy name processing to produce a standardised format for name handling.

### Installation

```shell script
composer require jaxwilko/human-name-processor
```

### Usage

```php
make('Mr. John Smith');
```

The processor make method returns an instance of `JaxName\HumanName` which provides methods for getting elements of
the name. For instance:

```php
$name->getTitle(); // Mr.
$name->getFirstName(); // John
$name->getLastName(); // Smith

// the class also provides a __toString method

echo $name; // Mr. John Smith
```

### Testing

```shell script
./vendor/bin/phpunit tests --testdox --color
```