jasonpriem / HumanNameParser.php

Returns the parts (leading initial, first, middle, last, suffix) of a name from a string.
MIT License
108 stars 42 forks source link

Don't attempt to parse a name that has no spaces #12

Closed gabeguz closed 3 years ago

gabeguz commented 9 years ago

If a name doesn't have any spaces in it then we can't know if it's a first, last, nick, suffix, prefix etc. So, just leave it as the nameStr and don't call the parse function.

While here, update the unit tests to add a case for a single name, and add phpunit to composer.json. I also had some difficulty running the unit tests at all, I needed to change the class names to match what was in the code.