NicklasWallgren / instagram-api

Instagram Private API
MIT License
148 stars 46 forks source link

Update Item.php fix return getUser function #62

Open nimabm opened 2 years ago

nimabm commented 2 years ago

fix return getUser function

NicklasWallgren commented 2 years ago

Hey, thanks for the contribution.

It might be a good idea to implement an DTO class, instead of type hinting it as an array. We could probably add a new class Instagram\SDK\Response\DTO\Feed\User containing the actual fields, e.g.

 [pk] => 301061552
            [username] => svt
            [full_name] => SVT
            [is_private] => 
            [profile_pic_url] => https://scontent-arn2-1.cdninstagram.com/v/t51.2885-19/s150x150/14596904_1693637237631948_3216786425731088384_a.jpg?_nc_ht=scontent-arn2-1.cdninstagram.com&_nc_cat=1&_nc_ohc=PfmGoi3PV2QAX9XDPk-&edm=ABmJApABAAAA&ccb=7-4&oh=00_AT89DGBWxDHryou3aWJAdI5o5Nz0rvOOpiNFzFchWe9BqA&oe=61CE8384&_nc_sid=6136e7
            [profile_pic_id] => 1391249175462635481_301061552
            [is_verified] => 1
            [follow_friction_type] => 0
            [has_anonymous_profile_picture] => 
            [is_unpublished] => 
            [is_favorite] => 
            [has_highlight_reels] => 
            [account_badges] => Array
                (
                )

            [latest_reel_media] => 0

Have a look at Instagram\SDK\Response\DTO\General\User for reference,