Skip to content

Commit

Permalink
prepare for going public; improve unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wyrfel committed May 12, 2017
1 parent 508e138 commit 419fb6d
Show file tree
Hide file tree
Showing 31 changed files with 1,088 additions and 240 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.idea
vendor
coverage
composer.phar
phpunit.xml
.idea
8 changes: 8 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
checks:
php: true
filter:
excluded_paths:
- vendor/
- tests/
paths:
- src/*
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: php
sudo: false
php:
- "7"
install:
- composer install
- composer dump-autoload -o
script:
- mkdir -p build/logs
- vendor/bin/phpunit --coverage-clover build/logs/clover.xml
after_script:
- php vendor/bin/coveralls -v
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014 THE ICONIC
Copyright (c) 2017 THE ICONIC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
# TheIconic Name Parser
# THE ICONIC Name Parser

## Purpose
This is a universal, language-independent name parser.

Its purpose is to split a single string containing a full name,
possibly including salutation, initials, suffixes etc., into
meaningful parts like firstname, lastname, initials, and so on.

It is mostly tailored towards english names but works pretty well
with non-english names as long as they use latin spelling.

E.g. **Mr Anthony R Von Fange III** is parsed to
- salutation: **Mr.**
- firstname: **Anthony**
- initials: **R**
- lastname: **von Fange**
- suffix: **III**

## Setup
```$xslt
composer require theiconic/name-parser
```

## Usage

```
Expand All @@ -23,3 +39,13 @@ echo $name->getNickname();
echo $name->getInitials();
echo $name->getSuffix();
```
An empty string is returned for missing parts.

## Examples

An wide array of successfully parsed names can be found in the
[parser unit test](https://github.com/theiconic/name-parser/blob/master/tests/ParserTest.php#L12-L12).

## License

THE ICONIC Name Parser library for PHP is released under the MIT License.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"php": ">=5.4"
},
"require-dev": {
"phpunit/phpunit": "^5.0",
"phpunit/phpunit": "^6.0",
"satooshi/php-coveralls": "^1.0"
},
"autoload": {
Expand Down
Loading

0 comments on commit 419fb6d

Please sign in to comment.