Skip to content

Commit febf833

Browse files
authored
Merge pull request #45 from arnidan/php-8
`mb_str_word_count` function fix & tests fix
2 parents 3ed14d8 + 6555b44 commit febf833

9 files changed

+420
-638
lines changed

.github/workflows/build.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
run:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
php-versions: ['7.4', '8.0']
11+
name: Testing on PHP ${{ matrix.php-versions }}
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: setup
15+
uses: shivammathur/setup-php@v2
16+
with:
17+
php-version: ${{ matrix.php-versions }}
18+
extensions: mbstring,bcmath
19+
tools: phpunit,composer
20+
- name: install deps
21+
run: composer install -o -q
22+
- name: run phpunit
23+
run: vendor/bin/phpunit

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
.idea
22
.DS_Store
3+
composer.lock
4+
.phpunit.result.cache
5+
vendor

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
PHP-Name-Parser
22
===============
33

4+
![Build Status](https://github.com/joshfraser/PHP-Name-Parser/workflows/build/badge.svg)
5+
46
PHP library to split names into their respective components. Besides detecting first and last names, this library attempts to handle prefixes, suffixes, initials and compound last names like "Von Fange". It also normalizes prefixes (Mister -> Mr.) and fixes capitalization (JOHN SMITH -> John Smith).
57

68
**Usage:**

composer.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
"name": "joshfraser/php-name-parser",
33
"description": "PHP library to split names into their respective components (first, last, etc)",
44
"require": {
5-
"php": "^5.5 || ^7.0"
5+
"php": "^5.5 || ^7.0 || ^8.0"
66
},
77
"autoload": {
8-
"files": [
9-
"parser.php"
10-
]
8+
"psr-4": {
9+
"": "./src"
10+
}
11+
},
12+
"require-dev": {
13+
"phpunit/phpunit": "^9"
1114
}
1215
}

0 commit comments

Comments
 (0)