Real stubs this time
All checks were successful
repod / nextcloud (push) Successful in 1m34s
repod / nodejs (push) Successful in 2m41s

This commit is contained in:
Michel Roux 2023-08-04 00:23:59 +02:00
parent df30ff2318
commit 8d72eee723
13 changed files with 228 additions and 61 deletions

View File

@ -31,5 +31,10 @@
<referencedClass name="Doctrine\DBAL\Schema\Table" />
</errorLevel>
</UndefinedDocblockClass>
<InvalidReturnType>
<errorLevel type="suppress">
<directory name="stubs" />
</errorLevel>
</InvalidReturnType>
</issueHandlers>
</psalm>

View File

@ -17,28 +17,75 @@ namespace OCA\GPodderSync\Core\EpisodeAction;
* id: int
* }
*/
interface EpisodeAction
class EpisodeAction
{
public function getPodcast(): string;
/**
* @return string
*/
public function getPodcast()
{
}
public function getEpisode(): string;
/**
* @return string
*/
public function getEpisode()
{
}
public function getAction(): string;
/**
* @return string
*/
public function getAction()
{
}
public function getTimestamp(): string;
/**
* @return string
*/
public function getTimestamp()
{
}
public function getStarted(): int;
/**
* @return int
*/
public function getStarted()
{
}
public function getPosition(): int;
/**
* @return int
*/
public function getPosition()
{
}
public function getTotal(): int;
/**
* @return int
*/
public function getTotal()
{
}
public function getGuid(): ?string;
/**
* @return ?string
*/
public function getGuid()
{
}
public function getId(): int;
/**
* @return int
*/
public function getId()
{
}
/**
* @return EpisodeActionType
*/
public function toArray(): array;
public function toArray()
{
}
}

View File

@ -4,12 +4,14 @@ declare(strict_types=1);
namespace OCA\GPodderSync\Core\EpisodeAction;
interface EpisodeActionReader
class EpisodeActionReader
{
/**
* @param array $episodeActionsArray []
* @return EpisodeAction[]
* @throws \InvalidArgumentException
*/
public function fromArray(array $episodeActionsArray): array;
public function fromArray(array $episodeActionsArray)
{
}
}

View File

@ -4,7 +4,12 @@ declare(strict_types=1);
namespace OCA\GPodderSync\Core\EpisodeAction;
interface EpisodeActionSaver
class EpisodeActionSaver
{
/**
* @return array
*/
public function saveEpisodeActions(array $episodeActionsArray, string $userId)
{
public function saveEpisodeActions(array $episodeActionsArray, string $userId): array;
}
}

View File

@ -13,17 +13,23 @@ namespace OCA\GPodderSync\Core\PodcastData;
* play: int
* }
*/
interface PodcastActionCounts extends \JsonSerializable
class PodcastActionCounts implements \JsonSerializable
{
public function incrementAction(string $action): void
{
public function incrementAction(string $action): void;
/**
* @return PodcastActionCountsType
*/
public function toArray(): array;
/**
* @return PodcastActionCountsType
*/
public function jsonSerialize(): array;
}
/**
* @return PodcastActionCountsType
*/
public function toArray()
{
}
/**
* @return PodcastActionCountsType
*/
public function jsonSerialize(): mixed
{
}
}

View File

@ -15,43 +15,88 @@ namespace OCA\GPodderSync\Core\PodcastData;
* imageBlob: ?string
* }
*/
interface PodcastData extends \JsonSerializable
class PodcastData implements \JsonSerializable
{
public function __toString(): string;
/**
* @return PodcastData
* @throws \Exception if the XML data could not be parsed
*/
public static function parseRssXml(string $xmlString, ?int $fetchedAtUnix = null): PodcastData;
public static function parseRssXml(string $xmlString, ?int $fetchedAtUnix = null)
{
}
public function getTitle(): ?string;
/**
* @return ?string
*/
public function getTitle()
{
}
public function getAuthor(): ?string;
/**
* @return ?string
*/
public function getAuthor()
{
}
public function getLink(): ?string;
/**
* @return ?string
*/
public function getLink()
{
}
public function getDescription(): ?string;
/**
* @return ?string
*/
public function getDescription()
{
}
public function getImageUrl(): ?string;
/**
* @return ?string
*/
public function getImageUrl()
{
}
public function getFetchedAtUnix(): ?int;
/**
* @return ?int
*/
public function getFetchedAtUnix()
{
}
public function getImageBlob(): ?string;
/**
* @return ?string
*/
public function getImageBlob()
{
}
public function setImageBlob(?string $blob): void;
public function setImageBlob(?string $blob): void
{
}
/**
* @return PodcastDataType
*/
public function toArray(): array;
public function toArray()
{
}
/**
* @return PodcastDataType
*/
public function jsonSerialize(): array;
public function jsonSerialize(): mixed
{
}
/**
* @param PodcastDataType $data
* @return PodcastData
*/
public static function fromArray(array $data): PodcastData;
public static function fromArray(array $data)
{
}
}

View File

@ -4,13 +4,33 @@ declare(strict_types=1);
namespace OCA\GPodderSync\Core\PodcastData;
interface PodcastDataReader
class PodcastDataReader
{
/**
* @return ?PodcastData
*/
public function getCachedOrFetchPodcastData(string $url, string $userId)
{
public function getCachedOrFetchPodcastData(string $url, string $userId): ?PodcastData;
public function fetchPodcastData(string $url, string $userId): ?PodcastData;
public function tryGetCachedPodcastData(string $url): ?PodcastData;
public function trySetCachedPodcastData(string $url, PodcastData $data): bool;
}
/**
* @return ?PodcastData
*/
public function fetchPodcastData(string $url, string $userId)
{
}
/**
* @return ?PodcastData
*/
public function tryGetCachedPodcastData(string $url)
{
}
/**
* @return bool
*/
public function trySetCachedPodcastData(string $url, PodcastData $data)
{
}
}

View File

@ -11,23 +11,44 @@ namespace OCA\GPodderSync\Core\PodcastData;
* actionCounts: PodcastActionCounts
* }
*/
interface PodcastMetrics extends \JsonSerializable
class PodcastMetrics implements \JsonSerializable
{
public function getUrl(): string;
public function getActionCounts(): PodcastActionCounts;
public function getListenedSeconds(): int;
public function addListenedSeconds(int $seconds): void;
/**
* @return PodcastMetricsType
* @return string
*/
public function toArray(): array;
/**
* @return PodcastMetricsType
*/
public function jsonSerialize(): array;
public function getUrl()
{
}
/**
* @return PodcastActionCounts
*/
public function getActionCounts()
{
}
/**
* @return int
*/
public function getListenedSeconds()
{
}
public function addListenedSeconds(int $seconds): void
{
}
/**
* @return PodcastMetricsType
*/
public function toArray()
{
}
/**
* @return PodcastMetricsType
*/
public function jsonSerialize(): mixed
{
}
}

View File

@ -4,10 +4,12 @@ declare(strict_types=1);
namespace OCA\GPodderSync\Core\PodcastData;
interface PodcastMetricsReader
class PodcastMetricsReader
{
/**
* @return PodcastMetrics[]
*/
public function metrics(string $userId): array;
public function metrics(string $userId)
{
}
}

View File

@ -4,11 +4,19 @@ declare(strict_types=1);
namespace OCA\GPodderSync\Core\SubscriptionChange;
interface SubscriptionChange
class SubscriptionChange
{
/**
* @return bool
*/
public function isSubscribed()
{
public function __toString(): string;
public function isSubscribed(): bool;
public function getUrl(): string;
}
/**
* @return string
*/
public function getUrl()
{
}
}

View File

@ -4,10 +4,12 @@ declare(strict_types=1);
namespace OCA\GPodderSync\Core\SubscriptionChange;
interface SubscriptionChangeRequestParser
class SubscriptionChangeRequestParser
{
/**
* @return SubscriptionChange[]
*/
public function createSubscriptionChangeList(array $urlsSubscribed, array $urlsUnsubscribed): array;
public function createSubscriptionChangeList(array $urlsSubscribed, array $urlsUnsubscribed)
{
}
}

View File

@ -4,7 +4,9 @@ declare(strict_types=1);
namespace OCA\GPodderSync\Core\SubscriptionChange;
interface SubscriptionChangeSaver
class SubscriptionChangeSaver
{
public function saveSubscriptionChanges(array $urlsSubscribed, array $urlsUnsubscribed, string $userId): void
{
public function saveSubscriptionChanges(array $urlsSubscribed, array $urlsUnsubscribed, string $userId): void;
}
}

View File

@ -4,10 +4,12 @@ declare(strict_types=1);
namespace OCA\GPodderSync\Core\SubscriptionChange;
interface SubscriptionChangesReader
class SubscriptionChangesReader
{
/**
* @return SubscriptionChange[]
*/
public static function mapToSubscriptionsChanges(array $urls, bool $subscribed): array;
public static function mapToSubscriptionsChanges(array $urls, bool $subscribed)
{
}
}