src/UserInterface/ImplementationUsingFullName.php
private function getFullNameBit($bit)
    {
        if (empty($this->full_name_bits)) {
            $full_name = $this->getFullName();

            if (empty($full_name)) {
                list($first_name, $last_name) = $this->getFirstAndLastNameFromEmail();

                if ($first_name && $last_name) {
                    $this->full_name_bits = (new HumanNameParser("$first_name $last_name"))->getArray();
                } else {
                    $this->full_name_bits = ['first' => $first_name];
                }
            } else {
                $this->full_name_bits = (new HumanNameParser($full_name))->getArray();
            }
        }

        return empty($this->full_name_bits[$bit]) ? '' : $this->full_name_bits[$bit];
    }
private function getFullNameBit($bit)
    {
        if (empty($this->full_name_bits)) {
            $full_name = $this->getFullName();

            if (empty($full_name)) {
                list($first_name, $last_name) = $this->getFirstAndLastNameFromEmail();

                if ($first_name && $last_name) {
                    $this->full_name_bits = (new HumanNameParser("$first_name $last_name"))->getArray();
                } else {
                    $this->full_name_bits = ['first' => $first_name];
                }
            } else {
                $this->full_name_bits = (new HumanNameParser($full_name))->getArray();
            }
        }

        return empty($this->full_name_bits[$bit]) ? '' : $this->full_name_bits[$bit];
    }
private function getFullNameBit ( $ bit ) { if ( empty ( $ this -> full_name_bits ) ) { $ full_name = $ this -> getFullName ( ) ; if ( empty ( $ full_name ) ) { list ( $ first_name , $ last_name ) = $ this -> getFirstAndLastNameFromEmail ( ) ; if ( $ first_name && $ last_name ) { $ this -> full_name_bits = ( new HumanNameParser ( "$first_name $last_name" ) ) -> getArray ( ) ; } else { $ this -> full_name_bits = [ 'first' => $ first_name ] ; } } else { $ this -> full_name_bits = ( new HumanNameParser ( $ full_name ) ) -> getArray ( ) ; } } return empty ( $ this -> full_name_bits [ $ bit ] ) ? '' : $ this -> full_name_bits [ $ bit ] ; }
Return first name bit.

@param  string $bit
@return string
Return first name bit .