Skip to content

Commit

Permalink
Add 32bit arch support for medias #78
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrimaud committed Jul 8, 2020
1 parent 75b91d8 commit 4f2cf82
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Instagram/Hydrator/ProfileHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function __construct(Profile $instagramProfile = null)
public function hydrateProfile(\StdClass $data): void
{
$this->profile->setId((int)$data->id);
$this->profile->setId32Bit($data->id);
$this->profile->setUserName($data->username);
$this->profile->setFullName($data->full_name);
$this->profile->setBiography($data->biography);
Expand Down
21 changes: 21 additions & 0 deletions src/Instagram/Model/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ class Profile
*/
private $id;

/**
* @var string
*/
private $id32Bit;

/**
* @var string
*/
Expand Down Expand Up @@ -338,4 +343,20 @@ public function __serialize(): array
{
return $this->toArray();
}

/**
* @return string
*/
public function getId32Bit(): string
{
return $this->id32Bit;
}

/**
* @param string $id32Bit
*/
public function setId32Bit(string $id32Bit): void
{
$this->id32Bit = $id32Bit;
}
}
2 changes: 1 addition & 1 deletion src/Instagram/Transport/JsonMediasDataFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class JsonMediasDataFeed extends AbstractDataFeed
public function fetchData(Profile $instagramProfile): \StdClass
{
$variables = [
'id' => $instagramProfile->getId(),
'id' => PHP_INT_SIZE === 4 ? $instagramProfile->getId32Bit() : $instagramProfile->getId(),
'first' => InstagramHelper::PAGINATION_DEFAULT,
'after' => $instagramProfile->getEndCursor(),
];
Expand Down

0 comments on commit 4f2cf82

Please sign in to comment.