Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ All notable changes to this project will be documented in this file.
- Changed default CLIENT_PULL_STRATEGY_INTERVAL value to 10 minutes.
- Changed code analysis tool from psalm to phpstan.
- Changed src/Controller/Api/AuthOidcController.php to get session from request.
- Nofified FeedType: Added support for video media.
- Nofified FeedType: Added support for video media and cleanup implementation.

### NB! Prior to 3.x the project was split into separate repositories

Expand Down
12 changes: 0 additions & 12 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -1824,18 +1824,6 @@ parameters:
count: 1
path: src/Feed/NotifiedFeedType.php

-
message: '#^Method App\\Feed\\NotifiedFeedType\:\:getFeedItemObject\(\) has parameter \$item with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Feed/NotifiedFeedType.php

-
message: '#^Method App\\Feed\\NotifiedFeedType\:\:getFeedItemObject\(\) return type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Feed/NotifiedFeedType.php

-
message: '#^Method App\\Feed\\NotifiedFeedType\:\:getMentions\(\) has parameter \$searchProfileIds with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
Expand Down
8 changes: 3 additions & 5 deletions src/Feed/NotifiedFeedType.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class NotifiedFeedType implements FeedTypeInterface
{
final public const string SUPPORTED_FEED_TYPE = FeedOutputModels::INSTAGRAM_OUTPUT;

private const int REQUEST_TIMEOUT = 10;
private const string BASE_URL = 'https://api.listen.notified.com';
private const string DATETIME_FORMAT = 'Y-m-d\TH:i:s.v\Z';
private const string LOOKBACK_PERIOD = '-3 months';
Expand Down Expand Up @@ -55,11 +54,10 @@ public function getData(Feed $feed): array

$token = $secrets['token'];

$feedItems = [];
$mentions = [];

try {
$data = $this->getMentions($token, 1, $pageSize, $configuration['feeds']);
$feedItems = array_map($this->getFeedItemObject(...), $data);
$mentions = $this->getMentions($token, 1, $pageSize, $configuration['feeds']);
} catch (\Throwable $throwable) {
$this->logger->error("NotifiedFeedType: Failed to get mentions: {$throwable->getMessage()}");
}
Expand All @@ -69,7 +67,7 @@ public function getData(Feed $feed): array
// Check that image/video is available and accessible, otherwise leave out the feed element.
// Use the content type to determine if the mediaUrl is an image or video.
// If the content type is not available, try to determine it from the file extension.
foreach ($feedItems as $dataItem) {
foreach ($mentions as $dataItem) {
$mediaUrl = $dataItem['mediaUrl'] ?? null;

if (!is_string($mediaUrl)) {
Expand Down
Loading