-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
2,163 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Crawling results. | ||
/result | ||
|
||
# Code editors. | ||
.idea | ||
#vagrant | ||
.vagrant | ||
|
||
# Composer. | ||
vendor/ | ||
composer.phar | ||
composer.lock | ||
|
||
# Os files. | ||
.DS_Store | ||
Desktop.ini | ||
._* | ||
Thumbs.db | ||
.Spotlight-V100 | ||
.Trashes | ||
tmp/ | ||
config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
The MIT License (MIT) | ||
|
||
Copyright (c) 2017 | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "adci/full-name-parser", | ||
"description": "Parses a human name", | ||
"license": "MIT", | ||
"type": "library", | ||
"keywords": [ | ||
"PHP", | ||
"parse", | ||
"parser", | ||
"name", | ||
"full name" | ||
], | ||
"authors": [ | ||
{ | ||
"name": "ADCI Solutions", | ||
"homepage": "https://www.adcisolutions.com" | ||
} | ||
], | ||
"support": { | ||
"issues": "https://github.com/adci/full-name-parser/issues", | ||
"source": "https://github.com/adci/full-name-parser" | ||
}, | ||
"require": { | ||
"php": ">=5.6" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": ">=4.8.28 <5" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"ADCI\\FullNameParser\\": "src/" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<phpunit | ||
colors="true" | ||
bootstrap="tests/bootstrap.php"> | ||
<testsuites> | ||
<testsuite name="Full Name Parser tests"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<!-- Filter for coverage reports. --> | ||
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">./src</directory> | ||
<!-- By definition test classes have no tests. --> | ||
<exclude> | ||
<directory suffix="Test.php">./src</directory> | ||
<directory suffix="TestBase.php">./src</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Class of FirstNameNotFoundException. | ||
*/ | ||
|
||
namespace ADCI\FullNameParser\Exception; | ||
|
||
/** | ||
* Exception of first name not found. | ||
* | ||
* Class FirstNameNotFoundException. | ||
* | ||
* @package FullNameParser | ||
*/ | ||
class FirstNameNotFoundException extends NameParsingException | ||
{ | ||
/** | ||
* Default message text. | ||
* | ||
* @var string | ||
*/ | ||
const MESSAGE = "Couldn't find a first name."; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function __construct($message = null, $code = 0, \Throwable $previous = null) | ||
{ | ||
parent::__construct($message ? $message : self::MESSAGE, $code, $previous); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Class of IncorrectInputException. | ||
*/ | ||
|
||
namespace ADCI\FullNameParser\Exception; | ||
|
||
/** | ||
* Exception of incorrect input. | ||
* | ||
* Class IncorrectInputException. | ||
* | ||
* @package FullNameParser | ||
*/ | ||
class IncorrectInputException extends NameParsingException | ||
{ | ||
|
||
/** | ||
* Default message text. | ||
* | ||
* @var string | ||
*/ | ||
const MESSAGE = "Incorrect input to parse."; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function __construct($message = null, $code = 0, \Throwable $previous = null) | ||
{ | ||
parent::__construct($message ? $message : self::MESSAGE, $code, $previous); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Class of LastNameNotFoundException. | ||
*/ | ||
|
||
namespace ADCI\FullNameParser\Exception; | ||
|
||
/** | ||
* Exception last name not found. | ||
* | ||
* Class LastNameNotFoundException. | ||
* | ||
* @package FullNameParser | ||
*/ | ||
class LastNameNotFoundException extends NameParsingException | ||
{ | ||
|
||
/** | ||
* Default message text. | ||
* | ||
* @var string | ||
*/ | ||
const MESSAGE = "Couldn't find a last name."; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function __construct($message = null, $code = 0, \Throwable $previous = null) | ||
{ | ||
parent::__construct($message ? $message : self::MESSAGE, $code, $previous); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Class of ManyMiddleNamesException. | ||
*/ | ||
|
||
namespace ADCI\FullNameParser\Exception; | ||
|
||
/** | ||
* Exception of many middle names found. | ||
* | ||
* Class ManyMiddleNamesException. | ||
* | ||
* @package FullNameParser | ||
*/ | ||
class ManyMiddleNamesException extends NameParsingException | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Class of NameParsingException. | ||
*/ | ||
|
||
namespace ADCI\FullNameParser\Exception; | ||
|
||
/** | ||
* Any exception for name parsing. | ||
* | ||
* Class NameParsingException. | ||
* | ||
* @package FullNameParser | ||
*/ | ||
class NameParsingException extends \Exception | ||
{ | ||
/** | ||
* NameParsingException constructor. | ||
* | ||
* @param string $message | ||
* Message of error. | ||
* @param int $code | ||
* Code of error. | ||
* @param \Throwable|null $previous | ||
* Previously chained error. | ||
*/ | ||
public function __construct($message, $code = 0, \Throwable $previous = null) | ||
{ | ||
parent::__construct($message, $code, $previous); | ||
} | ||
} |
Oops, something went wrong.