src/MalScraper/Model/User/UserModel.php
private function getFriend()
    {
        $friend = [];
        $friend_area = $this->_parser->find('.container-left .user-profile', 0);
        $friend_area = $friend_area->find('.user-friends', 0);

        $friend_count = $friend_area->prev_sibling()->find('a', 0)->plaintext;
        preg_match('/\(\d+\)/', $friend_count, $friend_count);
        $friend['count'] = str_replace(['(', ')'], '', $friend_count[0]);

        $friend['data'] = [];
        foreach ($friend_area->find('a') as $f) {
            $temp_friend = [];

            $temp_friend['name'] = $f->plaintext;
            $temp_friend['image'] = Helper::imageUrlCleaner($f->getAttribute('data-bg'));

            $friend['data'][] = $temp_friend;
        }

        return $friend;
    }
private function getFriend()
    {
        $friend = [];
        $friend_area = $this->_parser->find('.container-left .user-profile', 0);
        $friend_area = $friend_area->find('.user-friends', 0);

        $friend_count = $friend_area->prev_sibling()->find('a', 0)->plaintext;
        preg_match('/\(\d+\)/', $friend_count, $friend_count);
        $friend['count'] = str_replace(['(', ')'], '', $friend_count[0]);

        $friend['data'] = [];
        foreach ($friend_area->find('a') as $f) {
            $temp_friend = [];

            $temp_friend['name'] = $f->plaintext;
            $temp_friend['image'] = Helper::imageUrlCleaner($f->getAttribute('data-bg'));

            $friend['data'][] = $temp_friend;
        }

        return $friend;
    }
private function getFriend ( ) { $ friend = [ ] ; $ friend_area = $ this -> _parser -> find ( '.container-left .user-profile' , 0 ) ; $ friend_area = $ friend_area -> find ( '.user-friends' , 0 ) ; $ friend_count = $ friend_area -> prev_sibling ( ) -> find ( 'a' , 0 ) -> plaintext ; preg_match ( '/\(\d+\)/' , $ friend_count , $ friend_count ) ; $ friend [ 'count' ] = str_replace ( [ '(' , ')' ] , '' , $ friend_count [ 0 ] ) ; $ friend [ 'data' ] = [ ] ; foreach ( $ friend_area -> find ( 'a' ) as $ f ) { $ temp_friend = [ ] ; $ temp_friend [ 'name' ] = $ f -> plaintext ; $ temp_friend [ 'image' ] = Helper :: imageUrlCleaner ( $ f -> getAttribute ( 'data-bg' ) ) ; $ friend [ 'data' ] [ ] = $ temp_friend ; } return $ friend ; }
Get user friend.

@return array
Get user friend .