PHPackages                             boeki/migration-tool - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. boeki/migration-tool

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

boeki/migration-tool
====================

v1.0.8(3y ago)0536PHPPHP &gt;=5.3.0

Since Aug 26Pushed 3y ago1 watchersCompare

[ Source](https://github.com/JamesStandbridge/MigrationTool)[ Packagist](https://packagist.org/packages/boeki/migration-tool)[ RSS](/packages/boeki-migration-tool/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (9)DependenciesVersions (10)Used By (0)

MigrationTool
=============

[](#migrationtool)

Name Rectifier strategy
-----------------------

[](#name-rectifier-strategy)

#### Case one part name

[](#case-one-part-name)

##### Strategy

[](#strategy)

- The given character string is compared to each first name contained in the configuration file. Each time a first name is contained within the character string, then it is saved in a table of "matches"

```
    $matches = [];
   	foreach($firstnames as $firstname) {
   		$pos = strpos(strtolower($value), strtolower($firstname));

   		if($pos !== false) {
   			$matches[] = array("pos" => $pos, "firstname" => $firstname);
   		}
   	}
```

- We then loop on this table, and we consider that the first name that will be used will be the match found with the most character

```
	$best_matche = array("pos" => null, "firstname" => "");
	foreach($matches as $matche) {
		if(strlen($best_matche["firstname"]) < strlen($matche["firstname"]))
			$best_matche = $matche;
	}
```

- Now it remains to recover the last name. We first check which side of the chosen first name has the most character left. Then associate this character string with the last name

```
	$lastname = null;
	$lastname_is_before = $best_matche["pos"] > strlen($value) - ($best_matche["pos"] + strlen($best_matche["firstname"]));

	if($lastname_is_before)
		$lastname = substr($value, 0, $best_matche["pos"]);
	else
		$lastname = substr($value, $best_matche["pos"] + strlen($best_matche["firstname"]), strlen($value) - 1);
```

##### Examples

[](#examples)

```
$name = "JAMESSTANDBRIDGE";
var_dump(NameRectifier::SEPARATE($name));
```

return

```
array(2) {
  ["firstname"]=>
  string(5) "James"
  ["lastname"]=>
  string(11) "Standbridge"
}
```

---

```
$name = "STANDBRIDGEJames";
var_dump(NameRectifier::SEPARATE($name));
```

return

```
array(2) {
  ["firstname"]=>
  string(5) "James"
  ["lastname"]=>
  string(11) "Standbridge"
}
```

---

```
$name = "STANDBRIDGEJamesDEEGYZ";
var_dump(NameRectifier::SEPARATE($name));
```

return

```
array(2) {
  ["firstname"]=>
  string(5) "James"
  ["lastname"]=>
  string(11) "Standbridge"
}
```

---

#### Case multi-parts name

[](#case-multi-parts-name)

##### Strategy

[](#strategy-1)

- The given character string is separated by spaces in an array. Each part of the table is then compared to each first name contained in the configuration file in order to determine whether some are first names.

```
	$matches = [];
	foreach($firstnames as $firstname) {
		for($i = 0; $i < count($mapping); $i++) {
			if(strtolower($mapping[$i]['part']) == strtolower($firstname))
				$mapping[$i]['isFirstname'] = true;
		}
	}
```

- Then, we want to separate the different parts into two strings: the string in which we concatenate the last name and the other string the first names.
- If there is no first name in the array, then the last index of the array is considered to be a first name.

```
	$thereIsALastname = false;
	$thereIsAFirstname = false;
	foreach($mapping as $map) {
		if($map['isFirstname'] === false)
			$thereIsALastname = true;
		else
			$thereIsAFirstname = true;
	}

	//if no firstname, we set last slug to firstname
	if(!$thereIsAFirstname)
		$mapping[count($mapping) - 1]['isFirstname'] = true;
```

- If there are only first names, then the first index of the array is considered to be a family name and the others are first names.

```
	if($thereIsALastname) {
		//...
	} else {
		foreach($mapping as $key => $map) {
			if($key === 0 && count($mapping) > 1)
				$lastnames .= ucfirst(strtolower($map['part']))." ";
			else
				$firstnames .= ucfirst(strtolower($map['part']))." ";
		}
	}
```

- Otherwise, we separate in this way: we increment the array by separating the first and last names. If a family name is crossed, and a first name has already been concatenated then all subsequent parts are considered to be family names. Same thing if a compound first name is concatenated.

```
	$firstnames = "";
	$lastnames = "";
	$lastnameBarrier = false;
	$composedNameBarrier = false;

	if($thereIsALastname) {
		foreach($mapping as $map) {
			if($map['isFirstname'] && !$lastnameBarrier && !$composedNameBarrier) {

				$firstnames .= ucfirst(strtolower($map['part']))." ";
				$isComposed = strpos($map['part'], "-") !== false;
				if($isComposed)
					$composedNameBarrier = true;
			}
			else {
				$lastnames .= ucfirst(strtolower($map['part']))." ";
				if(strlen($firstnames) > 0)
					$lastnameBarrier = true;
			}
		}
	}
```

##### Examples

[](#examples-1)

```
$name = "STANDBRIDGE James";
var_dump(NameRectifier::SEPARATE($name));
```

return

```
array(2) {
  ["firstname"]=>
  string(5) "James"
  ["lastname"]=>
  string(11) "Standbridge"
}
```

---

```
$name = "Jean-baptiste lucas francois";
var_dump(NameRectifier::SEPARATE($name));
```

return

```
array(2) {
  ["firstname"]=>
  string(13) "Jean-baptiste"
  ["lastname"]=>
  string(14) "Lucas Francois"
}
```

---

```
$name = "Standbridge Ciron";
var_dump(NameRectifier::SEPARATE($name));
```

return

```
array(2) {
  ["firstname"]=>
  string(5) "Ciron"
  ["lastname"]=>
  string(11) "Standbridge"
}
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~73 days

Recently: every ~143 days

Total

9

Last Release

1141d ago

Major Versions

v0.0.1 → V1.0.02021-08-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/456c778c51395f6ed07bc4a3677696089ab856642a4737e44a8bc113becbac5a?d=identicon)[JamesStandbridge](/maintainers/JamesStandbridge)

---

Top Contributors

[![JamesStandbridge](https://avatars.githubusercontent.com/u/67155672?v=4)](https://github.com/JamesStandbridge "JamesStandbridge (16 commits)")

### Embed Badge

![Health badge](/badges/boeki-migration-tool/health.svg)

```
[![Health](https://phpackages.com/badges/boeki-migration-tool/health.svg)](https://phpackages.com/packages/boeki-migration-tool)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
