public function map(array $parts): array
    {
        // If we don't expect a lastname, match a mimimum of 2 parts
        $minumumParts = ($this->mapWithoutLastname ? 2 : 3);

        if (count($parts) < $minumumParts) {
            return $parts;
        }

        $start = $this->findFirstMapped(Firstname::class, $parts);

        if (false === $start) {
            return $parts;
        }

        return $this->mapFrom($start, $parts);
    }
public function map(array $parts): array
    {
        // If we don't expect a lastname, match a mimimum of 2 parts
        $minumumParts = ($this->mapWithoutLastname ? 2 : 3);

        if (count($parts) < $minumumParts) {
            return $parts;
        }

        $start = $this->findFirstMapped(Firstname::class, $parts);

        if (false === $start) {
            return $parts;
        }

        return $this->mapFrom($start, $parts);
    }
public function map ( array $ parts ) : array { // If we don't expect a lastname, match a mimimum of 2 parts $ minumumParts = ( $ this -> mapWithoutLastname ? 2 : 3 ) ; if ( count ( $ parts ) < $ minumumParts ) { return $ parts ; } $ start = $ this -> findFirstMapped ( Firstname :: class , $ parts ) ; if ( false === $ start ) { return $ parts ; } return $ this -> mapFrom ( $ start , $ parts ) ; }
map middlenames in the parts array

@param array $parts the name parts
@return array the mapped parts
map middlenames in the parts array