public function map(array $parts): array
    {
        $last = count($parts) - 1;

        foreach ($parts as $k => $part) {
            if ($part instanceof AbstractPart) {
                continue;
            }

            if (!$this->matchLastPart && $k === $last) {
                continue;
            }

            if ($this->isInitial($part)) {
                $parts[$k] = new Initial($part);
            }
        }

        return $parts;
    }
public function map(array $parts): array
    {
        $last = count($parts) - 1;

        foreach ($parts as $k => $part) {
            if ($part instanceof AbstractPart) {
                continue;
            }

            if (!$this->matchLastPart && $k === $last) {
                continue;
            }

            if ($this->isInitial($part)) {
                $parts[$k] = new Initial($part);
            }
        }

        return $parts;
    }
public function map ( array $ parts ) : array { $ last = count ( $ parts ) - 1 ; foreach ( $ parts as $ k => $ part ) { if ( $ part instanceof AbstractPart ) { continue ; } if ( ! $ this -> matchLastPart && $ k === $ last ) { continue ; } if ( $ this -> isInitial ( $ part ) ) { $ parts [ $ k ] = new Initial ( $ part ) ; } } return $ parts ; }
map intials in parts array

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