From 56a079eebd63cf96d1cc7b0a11b04e8964722533 Mon Sep 17 00:00:00 2001 From: Ivan Zverev Date: Fri, 2 Jul 2021 15:51:30 +0300 Subject: [PATCH 1/6] Item properties fixes + raw http response in response --- .gitignore | 2 + src/Response/DTO/General/Media/Caption.php | 185 ++++++++++++++++++ .../DTO/General/Media/CarouselMedia.php | 124 ++++++++++++ .../DTO/General/Media/ImageVersions2.php | 1 - src/Response/DTO/General/Media/Location.php | 117 +++++++++++ .../DTO/General/Media/VideoVersion.php | 26 ++- src/Response/DTO/Hashtag/Item.php | 84 ++++++-- src/Response/Responses/ResponseEnvelope.php | 19 ++ src/Response/Responses/ResponseInterface.php | 19 +- .../User/AuthenticatedUserResponse.php | 18 ++ .../AbstractResponseSerializer.php | 6 +- 11 files changed, 573 insertions(+), 28 deletions(-) create mode 100644 src/Response/DTO/General/Media/Caption.php create mode 100644 src/Response/DTO/General/Media/CarouselMedia.php create mode 100644 src/Response/DTO/General/Media/Location.php diff --git a/.gitignore b/.gitignore index 3e5d470..b7d3bf0 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ TODO.md .php_cs .php_cs.cache + +.idea/ diff --git a/src/Response/DTO/General/Media/Caption.php b/src/Response/DTO/General/Media/Caption.php new file mode 100644 index 0000000..c31a846 --- /dev/null +++ b/src/Response/DTO/General/Media/Caption.php @@ -0,0 +1,185 @@ +pk; + } + + /** + * @return int + */ + public function getUserId(): int + { + return $this->user_id; + } + + /** + * @return string + */ + public function getText(): string + { + return $this->text; + } + + /** + * @return int + */ + public function getType(): int + { + return $this->type; + } + + /** + * @return int + */ + public function getCreatedAt(): int + { + return $this->created_at; + } + + /** + * @return int + */ + public function getCreatedAtUtc(): int + { + return $this->created_at_utc; + } + + /** + * @return string + */ + public function getContentType(): string + { + return $this->content_type; + } + + /** + * @return string + */ + public function getStatus(): string + { + return $this->status; + } + + /** + * @return int + */ + public function getBitFlags(): int + { + return $this->bit_flags; + } + + /** + * @return bool + */ + public function isDidReportAsSpam(): bool + { + return $this->did_report_as_spam; + } + + /** + * @return bool + */ + public function isShareEnabled(): bool + { + return $this->share_enabled; + } + + /** + * @return User + */ + public function getUser(): User + { + return $this->user; + } + + /** + * @return bool + */ + public function isIsCovered(): bool + { + return $this->is_covered; + } + + /** + * @return int + */ + public function getMediaId(): int + { + return $this->media_id; + } + + /** + * @return bool + */ + public function isHasTranslation(): bool + { + return $this->has_translation; + } + + /** + * @return int + */ + public function getPrivateReplyStatus(): int + { + return $this->private_reply_status; + } + +} diff --git a/src/Response/DTO/General/Media/CarouselMedia.php b/src/Response/DTO/General/Media/CarouselMedia.php new file mode 100644 index 0000000..4e75c3d --- /dev/null +++ b/src/Response/DTO/General/Media/CarouselMedia.php @@ -0,0 +1,124 @@ +id; + } + + /** + * @return int + */ + public function getPk(): int + { + return $this->pk; + } + + /** + * @return int + */ + public function getMediaType(): int + { + return $this->media_type; + } + + /** + * @return ImageVersions2 + */ + public function getImageVersions2(): ImageVersions2 + { + return $this->image_versions2; + } + + /** + * @return int + */ + public function getOriginalWidth(): int + { + return $this->original_width; + } + + /** + * @return int + */ + public function getOriginalHeight(): int + { + return $this->original_height; + } + + /** + * @return string + */ + public function getCarouselParentId(): string + { + return $this->carousel_parent_id; + } + + /** + * @return bool + */ + public function isCanSeeInsightsAsBrand(): bool + { + return $this->can_see_insights_as_brand; + } + + /** + * @return bool + */ + public function isIsCommercial(): bool + { + return $this->is_commercial; + } + +} diff --git a/src/Response/DTO/General/Media/ImageVersions2.php b/src/Response/DTO/General/Media/ImageVersions2.php index 61a4843..aba7c16 100644 --- a/src/Response/DTO/General/Media/ImageVersions2.php +++ b/src/Response/DTO/General/Media/ImageVersions2.php @@ -11,7 +11,6 @@ */ final class ImageVersions2 { - /** * @var Image[] */ diff --git a/src/Response/DTO/General/Media/Location.php b/src/Response/DTO/General/Media/Location.php new file mode 100644 index 0000000..81bd2f7 --- /dev/null +++ b/src/Response/DTO/General/Media/Location.php @@ -0,0 +1,117 @@ +pk; + } + + /** + * @return string + */ + public function getShortName(): string + { + return $this->short_name; + } + + /** + * @return int + */ + public function getFacebookPlacesId(): int + { + return $this->facebook_places_id; + } + + /** + * @return string + */ + public function getExternalSource(): string + { + return $this->external_source; + } + + /** + * @return string + */ + public function getName(): string + { + return $this->name; + } + + /** + * @return string + */ + public function getAddress(): string + { + return $this->address; + } + + /** + * @return string + */ + public function getCity(): string + { + return $this->city; + } + + /** + * @return float + */ + public function getLng(): float + { + return $this->lng; + } + + /** + * @return float + */ + public function getLat(): float + { + return $this->lat; + } + + /** + * @return bool + */ + public function isIsEligibleForGuides(): bool + { + return $this->is_eligible_for_guides; + } + +} diff --git a/src/Response/DTO/General/Media/VideoVersion.php b/src/Response/DTO/General/Media/VideoVersion.php index ed3d5f2..677257c 100644 --- a/src/Response/DTO/General/Media/VideoVersion.php +++ b/src/Response/DTO/General/Media/VideoVersion.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Instagram\SDK\DTO\General\Media; +namespace Instagram\SDK\Response\DTO\General\Media; /** * Class VideoVersion @@ -11,6 +11,10 @@ */ final class VideoVersion { + /** + * @var string + */ + private $id; /** * @var int @@ -18,12 +22,12 @@ final class VideoVersion private $type; /** - * @var float + * @var int */ private $width; /** - * @var float + * @var int */ private $height; @@ -32,6 +36,14 @@ final class VideoVersion */ private $url; + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + /** * @return int */ @@ -41,17 +53,17 @@ public function getType(): int } /** - * @return float + * @return int */ - public function getWidth(): float + public function getWidth(): int { return $this->width; } /** - * @return float + * @return int */ - public function getHeight(): float + public function getHeight(): int { return $this->height; } diff --git a/src/Response/DTO/Hashtag/Item.php b/src/Response/DTO/Hashtag/Item.php index 364d240..2f757d2 100644 --- a/src/Response/DTO/Hashtag/Item.php +++ b/src/Response/DTO/Hashtag/Item.php @@ -4,7 +4,12 @@ namespace Instagram\SDK\Response\DTO\Hashtag; +use Instagram\SDK\Response\DTO\General\Media\Caption; +use Instagram\SDK\Response\DTO\General\Media\CarouselMedia; use Instagram\SDK\Response\DTO\General\Media\ImageVersions2; +use Instagram\SDK\Response\DTO\General\Media\Location; +use Instagram\SDK\Response\DTO\General\Media\VideoVersion; +use Instagram\SDK\Response\DTO\General\User; /** * Class Item @@ -13,7 +18,6 @@ */ final class Item { - /** * @var float */ @@ -55,10 +59,15 @@ final class Item private $filterType; /** - * @var ImageVersions2[] + * @var ImageVersions2[]|null */ private $imageVersions2; + /** + * @var CarouselMedia[]|null + */ + private $carousel_media; + /** * @var float */ @@ -70,7 +79,7 @@ final class Item private $originalHeight; /** - * @var object + * @var VideoVersion[]|null */ private $videoVersions; @@ -80,22 +89,37 @@ final class Item private $hasAudio; /** - * @var int + * @var int|null */ private $videoDuration; /** - * @var int + * @var int|null */ private $viewCount; /** - * @var object // TODO + * @var Location|null + */ + private $location; + + /** + * @var float|null + */ + private $lng; + + /** + * @var float|null + */ + private $lat; + + /** + * @var User */ private $user; /** - * @var object // TODO + * @var Caption */ private $caption; @@ -226,11 +250,19 @@ public function getFilterType(): int /** * @return ImageVersions2[] */ - public function getImageVersions2(): array + public function getImageVersions2(): ?array { return $this->imageVersions2; } + /** + * @return CarouselMedia[] + */ + public function getCarouselMedia(): ?array + { + return $this->carousel_media; + } + /** * @return float */ @@ -248,9 +280,9 @@ public function getOriginalHeight(): float } /** - * @return object + * @return VideoVersion[]|null */ - public function getVideoVersions(): object + public function getVideoVersions(): ?array { return $this->videoVersions; } @@ -280,17 +312,41 @@ public function getViewCount(): int } /** - * @return object + * @return Location|null + */ + public function getLocation(): ?Location + { + return $this->location; + } + + /** + * @return float|null + */ + public function getLng(): ?float + { + return $this->lng; + } + + /** + * @return float|null + */ + public function getLat(): ?float + { + return $this->lat; + } + + /** + * @return User */ - public function getUser(): object + public function getUser(): User { return $this->user; } /** - * @return object + * @return Caption */ - public function getCaption(): object + public function getCaption(): Caption { return $this->caption; } diff --git a/src/Response/Responses/ResponseEnvelope.php b/src/Response/Responses/ResponseEnvelope.php index 4b8fd66..74d1185 100644 --- a/src/Response/Responses/ResponseEnvelope.php +++ b/src/Response/Responses/ResponseEnvelope.php @@ -4,6 +4,8 @@ namespace Instagram\SDK\Response\Responses; +use Psr\Http\Message\ResponseInterface as HttpResponseInterface; + /** * Class ResponseEnvelope * @@ -27,6 +29,9 @@ abstract class ResponseEnvelope implements ResponseInterface /** @var bool */ protected $invalidCredentials; + /** @var HttpResponseInterface|null */ + protected $rawResponse; + /** * @return string|null */ @@ -68,4 +73,18 @@ public function isSuccess(): bool { return $this->status === static::STATUS_SUCCESS; } + + /** @inheritdoc */ + public function getRawResponse(): HttpResponseInterface + { + return $this->rawResponse; + } + + /** @inheritdoc */ + public function setRawResponse(HttpResponseInterface $response): ResponseInterface + { + $this->rawResponse = $response; + + return $this; + } } diff --git a/src/Response/Responses/ResponseInterface.php b/src/Response/Responses/ResponseInterface.php index 0e7013c..f4090ec 100644 --- a/src/Response/Responses/ResponseInterface.php +++ b/src/Response/Responses/ResponseInterface.php @@ -4,6 +4,8 @@ namespace Instagram\SDK\Response\Responses; +use Psr\Http\Message\ResponseInterface as HttpResponseInterface; + /** * Interface ResponseInterface * @@ -11,9 +13,16 @@ */ interface ResponseInterface { - - - - - + /** + * raw http response getter, useful for debugging, using not implemented things + * + * @return HttpResponseInterface + */ + public function getRawResponse(): HttpResponseInterface; + + /** + * @param HttpResponseInterface $response + * @return ResponseInterface + */ + public function setRawResponse(HttpResponseInterface $response): ResponseInterface; } diff --git a/src/Response/Responses/User/AuthenticatedUserResponse.php b/src/Response/Responses/User/AuthenticatedUserResponse.php index a134b56..81f0146 100644 --- a/src/Response/Responses/User/AuthenticatedUserResponse.php +++ b/src/Response/Responses/User/AuthenticatedUserResponse.php @@ -6,6 +6,7 @@ use Instagram\SDK\Response\Responses\ResponseInterface; use Instagram\SDK\Session\Session; +use Psr\Http\Message\ResponseInterface as HttpResponseInterface; /** * Class AuthenticatedUserResponse @@ -18,6 +19,9 @@ class AuthenticatedUserResponse implements ResponseInterface /** @var Session */ private $session; + /** @var HttpResponseInterface */ + protected $rawResponse; + /** * AuthenticatedUserResponse constructor. * @@ -35,4 +39,18 @@ public function getSession(): Session { return $this->session; } + + /** @inheritdoc */ + public function getRawResponse(): HttpResponseInterface + { + return $this->rawResponse; + } + + /** @inheritdoc */ + public function setRawResponse(HttpResponseInterface $response): ResponseInterface + { + $this->rawResponse = $response; + + return $this; + } } diff --git a/src/Response/Serializers/AbstractResponseSerializer.php b/src/Response/Serializers/AbstractResponseSerializer.php index 8ece22d..722e7dd 100644 --- a/src/Response/Serializers/AbstractResponseSerializer.php +++ b/src/Response/Serializers/AbstractResponseSerializer.php @@ -53,7 +53,11 @@ public function decode(HttpResponseInterface $response, Client $client): Respons ->setReaderContext(new OnDecodeContext($client)) ->build(); - $gson->fromJson((string)$response->getBody(), $responseInstance); + $body = (string)$response->getBody(); + + $gson->fromJson($body, $responseInstance); + + $responseInstance->setRawResponse($response); if (!self::isValidResponse($responseInstance)) { throw $this->toException($responseInstance->getErrorType(), $responseInstance); From 9411eeb9ccf43c88fb3a6f0ab2910ee5ed2a16f6 Mon Sep 17 00:00:00 2001 From: Ivan Zverev Date: Fri, 2 Jul 2021 16:36:58 +0300 Subject: [PATCH 2/6] video version in carousel --- src/Response/DTO/General/Media/CarouselMedia.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Response/DTO/General/Media/CarouselMedia.php b/src/Response/DTO/General/Media/CarouselMedia.php index 4e75c3d..8875bce 100644 --- a/src/Response/DTO/General/Media/CarouselMedia.php +++ b/src/Response/DTO/General/Media/CarouselMedia.php @@ -24,6 +24,12 @@ final class CarouselMedia */ private $image_versions2; + + /** + * @var VideoVersion[] + */ + private $video_versions; + /** * @var int */ @@ -81,6 +87,14 @@ public function getImageVersions2(): ImageVersions2 return $this->image_versions2; } + /** + * @return VideoVersion[] + */ + public function getVideoVersions(): array + { + return $this->video_versions; + } + /** * @return int */ From 0563cbc95def4aa8d986b03348e43f39f21f00a0 Mon Sep 17 00:00:00 2001 From: Ivan Zverev Date: Fri, 2 Jul 2021 17:20:17 +0300 Subject: [PATCH 3/6] location feed + fixes --- src/Client/Features/FeedFeaturesTrait.php | 15 ++++++++++++ .../DTO/General/Media/CarouselMedia.php | 12 +++++----- src/Response/DTO/General/Media/Location.php | 12 +++++----- src/Response/DTO/General/User.php | 4 ++-- src/Response/DTO/Hashtag/Item.php | 6 ++--- src/Response/DTO/Interfaces/UserInterface.php | 4 ++-- src/Traits/MakeFeedRequestsAccessible.php | 24 +++++++++++++++++++ src/definitions.php | 3 +++ 8 files changed, 61 insertions(+), 19 deletions(-) diff --git a/src/Client/Features/FeedFeaturesTrait.php b/src/Client/Features/FeedFeaturesTrait.php index d4faec1..c14cf14 100644 --- a/src/Client/Features/FeedFeaturesTrait.php +++ b/src/Client/Features/FeedFeaturesTrait.php @@ -11,6 +11,7 @@ use Instagram\SDK\Response\Responses\Feed\FeedResponse; use Instagram\SDK\Response\Responses\Feed\TimelineResponse; use const Instagram\SDK\TYPE_HASHTAG; +use const Instagram\SDK\TYPE_LOCATION; use const Instagram\SDK\TYPE_USER; /** @@ -34,6 +35,17 @@ public function feedByHashtag(string $hashTag): PromiseInterface return $this->feed(TYPE_HASHTAG, $hashTag); } + /** + * Retrieve feed by hashtag. + * + * @param string $locationId + * @return PromiseInterface + */ + public function feedByLocation(string $locationId): PromiseInterface + { + return $this->feed(TYPE_LOCATION, $locationId); + } + /** * Retrieve feed by user id. * @@ -62,6 +74,9 @@ public function feed(int $type, string $query, ?string $maxId = null): PromiseIn case TYPE_USER: $result = $this->queryFeed($type, 'feed/user/%s/', $query, $maxId); break; + case TYPE_LOCATION: + $result = $this->queryFeed($type, 'feed/location/%s/', $query, $maxId); + break; default: $result = $this->getInvalidFeedTypeError(); break; diff --git a/src/Response/DTO/General/Media/CarouselMedia.php b/src/Response/DTO/General/Media/CarouselMedia.php index 8875bce..840bc2a 100644 --- a/src/Response/DTO/General/Media/CarouselMedia.php +++ b/src/Response/DTO/General/Media/CarouselMedia.php @@ -20,13 +20,13 @@ final class CarouselMedia private $media_type; /** - * @var ImageVersions2 + * @var ImageVersions2[]|null */ private $image_versions2; /** - * @var VideoVersion[] + * @var VideoVersion[]|null */ private $video_versions; @@ -80,17 +80,17 @@ public function getMediaType(): int } /** - * @return ImageVersions2 + * @return ImageVersions2[]|null */ - public function getImageVersions2(): ImageVersions2 + public function getImageVersions2(): ?array { return $this->image_versions2; } /** - * @return VideoVersion[] + * @return VideoVersion[]|null */ - public function getVideoVersions(): array + public function getVideoVersions(): ?array { return $this->video_versions; } diff --git a/src/Response/DTO/General/Media/Location.php b/src/Response/DTO/General/Media/Location.php index 81bd2f7..9a65211 100644 --- a/src/Response/DTO/General/Media/Location.php +++ b/src/Response/DTO/General/Media/Location.php @@ -25,10 +25,10 @@ final class Location /** @var string */ private $city; - /** @var float */ + /** @var float|null */ private $lng; - /** @var float */ + /** @var float|null */ private $lat; /** @var bool */ @@ -91,17 +91,17 @@ public function getCity(): string } /** - * @return float + * @return float|null */ - public function getLng(): float + public function getLng(): ?float { return $this->lng; } /** - * @return float + * @return float|null */ - public function getLat(): float + public function getLat(): ?float { return $this->lat; } diff --git a/src/Response/DTO/General/User.php b/src/Response/DTO/General/User.php index 4acb5aa..7a212ac 100644 --- a/src/Response/DTO/General/User.php +++ b/src/Response/DTO/General/User.php @@ -113,9 +113,9 @@ public function isPrivate(): bool } /** - * @return string + * @return string|null */ - public function getProfilePictureUrl(): string + public function getProfilePictureUrl(): ?string { return $this->profilePictureUrl; } diff --git a/src/Response/DTO/Hashtag/Item.php b/src/Response/DTO/Hashtag/Item.php index 2f757d2..91441c5 100644 --- a/src/Response/DTO/Hashtag/Item.php +++ b/src/Response/DTO/Hashtag/Item.php @@ -164,7 +164,7 @@ final class Item private $maxNumVisiblePreviewComments; /** - * @var int + * @var int|null */ private $commentCount; @@ -416,9 +416,9 @@ public function getMaxNumVisiblePreviewComments(): int } /** - * @return int + * @return int|null */ - public function getCommentCount(): int + public function getCommentCount(): ?int { return $this->commentCount; } diff --git a/src/Response/DTO/Interfaces/UserInterface.php b/src/Response/DTO/Interfaces/UserInterface.php index 4a715ec..671bc0e 100644 --- a/src/Response/DTO/Interfaces/UserInterface.php +++ b/src/Response/DTO/Interfaces/UserInterface.php @@ -43,9 +43,9 @@ public function isPrivate(): bool; /** * Returns the profile picture url. * - * @return string + * @return string|null */ - public function getProfilePictureUrl(): string; + public function getProfilePictureUrl(): ?string; /** * Returns true if the profile has a anonymous profile picture, false otherwise. diff --git a/src/Traits/MakeFeedRequestsAccessible.php b/src/Traits/MakeFeedRequestsAccessible.php index 9a4d535..149dc04 100644 --- a/src/Traits/MakeFeedRequestsAccessible.php +++ b/src/Traits/MakeFeedRequestsAccessible.php @@ -12,6 +12,7 @@ use Instagram\SDK\Response\Responses\Feed\TimelineResponse; use Instagram\SDK\Utils\PromiseUtils; use const Instagram\SDK\TYPE_HASHTAG; +use const Instagram\SDK\TYPE_LOCATION; use const Instagram\SDK\TYPE_USER; /** @@ -34,6 +35,18 @@ public function feedByHashtag(string $tag): FeedResponse return PromiseUtils::wait($this->feedByHashtagPromise($tag)); } + /** + * Retrieves feed by location. + * + * @param string $locationId + * @return FeedResponse + * @throws InstagramException in case of an error + */ + public function feedByLocation(string $locationId): FeedResponse + { + return PromiseUtils::wait($this->feedByLocationPromise($locationId)); + } + /** * Retrieves feed by hashtag. * @@ -45,6 +58,17 @@ public function feedByHashtagPromise(string $tag): PromiseInterface return $this->feed(TYPE_HASHTAG, $tag); } + /** + * Retrieves feed by location. + * + * @param string $locationId + * @return PromiseInterface + */ + public function feedByLocationPromise(string $locationId): PromiseInterface + { + return $this->feed(TYPE_LOCATION, $locationId); + } + /** * Retrieves feed by user. * diff --git a/src/definitions.php b/src/definitions.php index 753eb3c..2537aa3 100644 --- a/src/definitions.php +++ b/src/definitions.php @@ -9,3 +9,6 @@ /** @var int The user feed type */ const TYPE_USER = 2; + +/** @var int The hashtag feed type */ +const TYPE_LOCATION = 3; From 0f3c70a80bf6e248890c7b0c65aaf484e229cb4e Mon Sep 17 00:00:00 2001 From: Ivan Zverev Date: Thu, 8 Jul 2021 01:09:06 +0300 Subject: [PATCH 4/6] caption can be null --- src/Response/DTO/Hashtag/Item.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Response/DTO/Hashtag/Item.php b/src/Response/DTO/Hashtag/Item.php index 91441c5..63b41be 100644 --- a/src/Response/DTO/Hashtag/Item.php +++ b/src/Response/DTO/Hashtag/Item.php @@ -344,9 +344,9 @@ public function getUser(): User } /** - * @return Caption + * @return Caption|null */ - public function getCaption(): Caption + public function getCaption(): ?Caption { return $this->caption; } From 809b0899f8850caebed356cd549280a738ecbe5a Mon Sep 17 00:00:00 2001 From: Ivan Zverev Date: Thu, 16 Sep 2021 15:35:57 +0300 Subject: [PATCH 5/6] product_type in item --- src/Response/DTO/Hashtag/Item.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Response/DTO/Hashtag/Item.php b/src/Response/DTO/Hashtag/Item.php index 63b41be..9e3c439 100644 --- a/src/Response/DTO/Hashtag/Item.php +++ b/src/Response/DTO/Hashtag/Item.php @@ -183,6 +183,11 @@ final class Item */ private $organicTrackingToken; + /** + * @var string|null + */ + private $productType; + /** * @return int */ @@ -446,4 +451,12 @@ public function getOrganicTrackingToken(): string { return $this->organicTrackingToken; } + + /** + * @return string|null + */ + public function getProductType(): ?string + { + return $this->productType; + } } From 25fe31c03aebcaa46640404d0475e970394446a9 Mon Sep 17 00:00:00 2001 From: Ivan Zverev Date: Thu, 16 Sep 2021 17:30:21 +0300 Subject: [PATCH 6/6] image versions not an array --- src/Response/DTO/General/Media/CarouselMedia.php | 6 +++--- src/Response/DTO/Hashtag/Item.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Response/DTO/General/Media/CarouselMedia.php b/src/Response/DTO/General/Media/CarouselMedia.php index 840bc2a..c06f569 100644 --- a/src/Response/DTO/General/Media/CarouselMedia.php +++ b/src/Response/DTO/General/Media/CarouselMedia.php @@ -20,7 +20,7 @@ final class CarouselMedia private $media_type; /** - * @var ImageVersions2[]|null + * @var ImageVersions2|null */ private $image_versions2; @@ -80,9 +80,9 @@ public function getMediaType(): int } /** - * @return ImageVersions2[]|null + * @return ImageVersions2|null */ - public function getImageVersions2(): ?array + public function getImageVersions2(): ?ImageVersions2 { return $this->image_versions2; } diff --git a/src/Response/DTO/Hashtag/Item.php b/src/Response/DTO/Hashtag/Item.php index 9e3c439..864f206 100644 --- a/src/Response/DTO/Hashtag/Item.php +++ b/src/Response/DTO/Hashtag/Item.php @@ -59,7 +59,7 @@ final class Item private $filterType; /** - * @var ImageVersions2[]|null + * @var ImageVersions2|null */ private $imageVersions2; @@ -253,9 +253,9 @@ public function getFilterType(): int } /** - * @return ImageVersions2[] + * @return ImageVersions2 */ - public function getImageVersions2(): ?array + public function getImageVersions2(): ?ImageVersions2 { return $this->imageVersions2; }