build: update js and php dependencies to latest
This commit is contained in:
parent
23a47efefd
commit
a00e45ea4c
|
@ -21,6 +21,7 @@ use CodeIgniter\HTTP\RequestInterface;
|
|||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Config\Services;
|
||||
use Modules\Analytics\Config\Analytics;
|
||||
use Modules\PremiumPodcasts\Entities\Subscription;
|
||||
use Modules\PremiumPodcasts\Models\SubscriptionModel;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
|
@ -65,7 +66,7 @@ class EpisodeAudioController extends Controller
|
|||
}
|
||||
|
||||
if (
|
||||
($podcast = (new PodcastModel())->getPodcastByHandle($params[0])) === null
|
||||
! ($podcast = (new PodcastModel())->getPodcastByHandle($params[0])) instanceof Podcast
|
||||
) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
@ -73,7 +74,7 @@ class EpisodeAudioController extends Controller
|
|||
$this->podcast = $podcast;
|
||||
|
||||
if (
|
||||
($episode = (new EpisodeModel())->getEpisodeBySlug($params[0], $params[1])) === null
|
||||
! ($episode = (new EpisodeModel())->getEpisodeBySlug($params[0], $params[1])) instanceof Episode
|
||||
) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
@ -108,10 +109,10 @@ class EpisodeAudioController extends Controller
|
|||
}
|
||||
|
||||
// check if there's a valid subscription for the provided token
|
||||
if (($subscription = (new SubscriptionModel())->validateSubscription(
|
||||
if (! ($subscription = (new SubscriptionModel())->validateSubscription(
|
||||
$this->episode->podcast->handle,
|
||||
$token
|
||||
)) === null) {
|
||||
)) instanceof Subscription) {
|
||||
return $this->response->setStatusCode(401, 'Invalid token!')
|
||||
->setJSON([
|
||||
'errors' => [
|
||||
|
|
|
@ -45,7 +45,7 @@ class EpisodeCommentController extends BaseController
|
|||
}
|
||||
|
||||
if (
|
||||
($podcast = (new PodcastModel())->getPodcastByHandle($params[0])) === null
|
||||
! ($podcast = (new PodcastModel())->getPodcastByHandle($params[0])) instanceof Podcast
|
||||
) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ class EpisodeCommentController extends BaseController
|
|||
$this->actor = $podcast->actor;
|
||||
|
||||
if (
|
||||
($episode = (new EpisodeModel())->getEpisodeBySlug($params[0], $params[1])) === null
|
||||
! ($episode = (new EpisodeModel())->getEpisodeBySlug($params[0], $params[1])) instanceof Episode
|
||||
) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ class EpisodeCommentController extends BaseController
|
|||
$this->episode = $episode;
|
||||
|
||||
if (
|
||||
($comment = (new EpisodeCommentModel())->getCommentById($params[2])) === null
|
||||
! ($comment = (new EpisodeCommentModel())->getCommentById($params[2])) instanceof EpisodeComment
|
||||
) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ class EpisodeController extends BaseController
|
|||
}
|
||||
|
||||
if (
|
||||
($podcast = (new PodcastModel())->getPodcastByHandle($params[0])) === null
|
||||
! ($podcast = (new PodcastModel())->getPodcastByHandle($params[0])) instanceof Podcast
|
||||
) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ class EpisodeController extends BaseController
|
|||
$this->podcast = $podcast;
|
||||
|
||||
if (
|
||||
($episode = (new EpisodeModel())->getEpisodeBySlug($params[0], $params[1])) === null
|
||||
! ($episode = (new EpisodeModel())->getEpisodeBySlug($params[0], $params[1])) instanceof Episode
|
||||
) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ use CodeIgniter\Controller;
|
|||
use CodeIgniter\Exceptions\PageNotFoundException;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Exception;
|
||||
use Modules\PremiumPodcasts\Entities\Subscription;
|
||||
use Modules\PremiumPodcasts\Models\SubscriptionModel;
|
||||
use Opawg\UserAgentsPhp\UserAgentsRSS;
|
||||
|
||||
|
@ -56,7 +57,7 @@ class FeedController extends Controller
|
|||
"podcast#{$podcast->id}",
|
||||
'feed',
|
||||
$service ? $serviceSlug : null,
|
||||
$subscription !== null ? 'unlocked' : null,
|
||||
$subscription instanceof Subscription ? 'unlocked' : null,
|
||||
]),
|
||||
);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ class PodcastController extends BaseController
|
|||
}
|
||||
|
||||
if (
|
||||
($podcast = (new PodcastModel())->getPodcastByHandle($params[0])) === null
|
||||
! ($podcast = (new PodcastModel())->getPodcastByHandle($params[0])) instanceof Podcast
|
||||
) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ class PostController extends FediversePostController
|
|||
public function _remap(string $method, string ...$params): mixed
|
||||
{
|
||||
if (
|
||||
($podcast = (new PodcastModel())->getPodcastByHandle($params[0])) === null
|
||||
! ($podcast = (new PodcastModel())->getPodcastByHandle($params[0])) instanceof Podcast
|
||||
) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
@ -55,9 +55,8 @@ class PostController extends FediversePostController
|
|||
|
||||
if (
|
||||
count($params) > 1 &&
|
||||
($post = (new PostModel())->getPostById($params[1])) !== null
|
||||
($post = (new PostModel())->getPostById($params[1])) instanceof CastopodPost
|
||||
) {
|
||||
/** @var CastopodPost $post */
|
||||
$this->post = $post;
|
||||
|
||||
unset($params[0]);
|
||||
|
|
|
@ -10,6 +10,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Entities\Podcast;
|
||||
use App\Models\PodcastModel;
|
||||
use CodeIgniter\Controller;
|
||||
use CodeIgniter\Exceptions\PageNotFoundException;
|
||||
|
@ -79,7 +80,7 @@ class WebmanifestController extends Controller
|
|||
public function podcastManifest(string $podcastHandle): ResponseInterface
|
||||
{
|
||||
if (
|
||||
($podcast = (new PodcastModel())->getPodcastByHandle($podcastHandle)) === null
|
||||
! ($podcast = (new PodcastModel())->getPodcastByHandle($podcastHandle)) instanceof Podcast
|
||||
) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ class Actor extends FediverseActor
|
|||
|
||||
public function getIsPodcast(): bool
|
||||
{
|
||||
return $this->getPodcast() !== null;
|
||||
return $this->getPodcast() instanceof Podcast;
|
||||
}
|
||||
|
||||
public function getPodcast(): ?Podcast
|
||||
|
@ -44,7 +44,7 @@ class Actor extends FediverseActor
|
|||
|
||||
public function getAvatarImageUrl(): string
|
||||
{
|
||||
if ($this->podcast !== null) {
|
||||
if ($this->podcast instanceof Podcast) {
|
||||
return $this->podcast->cover->thumbnail_url;
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ class Actor extends FediverseActor
|
|||
|
||||
public function getAvatarImageMimetype(): string
|
||||
{
|
||||
if ($this->podcast !== null) {
|
||||
if ($this->podcast instanceof Podcast) {
|
||||
return $this->podcast->cover->thumbnail_mimetype;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,8 +50,8 @@ use RuntimeException;
|
|||
* @property string|null $description Holds text only description, striped of any markdown or html special characters
|
||||
* @property string $description_markdown
|
||||
* @property string $description_html
|
||||
* @property int $cover_id
|
||||
* @property Image $cover
|
||||
* @property ?int $cover_id
|
||||
* @property ?Image $cover
|
||||
* @property int|null $transcript_id
|
||||
* @property Transcript|null $transcript
|
||||
* @property string|null $transcript_remote_url
|
||||
|
@ -179,7 +179,7 @@ class Episode extends Entity
|
|||
|
||||
public function setCover(UploadedFile | File $file = null): self
|
||||
{
|
||||
if ($file === null || ($file instanceof UploadedFile && ! $file->isValid())) {
|
||||
if (! $file instanceof File || ($file instanceof UploadedFile && ! $file->isValid())) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -225,7 +225,7 @@ class Episode extends Entity
|
|||
|
||||
public function setAudio(UploadedFile | File $file = null): self
|
||||
{
|
||||
if ($file === null || ($file instanceof UploadedFile && ! $file->isValid())) {
|
||||
if (! $file instanceof File || ($file instanceof UploadedFile && ! $file->isValid())) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -265,11 +265,11 @@ class Episode extends Entity
|
|||
|
||||
public function setTranscript(UploadedFile | File $file = null): self
|
||||
{
|
||||
if ($file === null || ($file instanceof UploadedFile && ! $file->isValid())) {
|
||||
if (! $file instanceof File || ($file instanceof UploadedFile && ! $file->isValid())) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
if ($this->getTranscript() !== null) {
|
||||
if ($this->getTranscript() instanceof Transcript) {
|
||||
$this->getTranscript()
|
||||
->setFile($file);
|
||||
$this->getTranscript()
|
||||
|
@ -293,7 +293,7 @@ class Episode extends Entity
|
|||
|
||||
public function getTranscript(): ?Transcript
|
||||
{
|
||||
if ($this->transcript_id !== null && $this->transcript === null) {
|
||||
if ($this->transcript_id !== null && ! $this->transcript instanceof Transcript) {
|
||||
$this->transcript = (new MediaModel('transcript'))->getMediaById($this->transcript_id);
|
||||
}
|
||||
|
||||
|
@ -302,11 +302,11 @@ class Episode extends Entity
|
|||
|
||||
public function setChapters(UploadedFile | File $file = null): self
|
||||
{
|
||||
if ($file === null || ($file instanceof UploadedFile && ! $file->isValid())) {
|
||||
if (! $file instanceof File || ($file instanceof UploadedFile && ! $file->isValid())) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
if ($this->getChapters() !== null) {
|
||||
if ($this->getChapters() instanceof Chapters) {
|
||||
$this->getChapters()
|
||||
->setFile($file);
|
||||
$this->getChapters()
|
||||
|
@ -330,7 +330,7 @@ class Episode extends Entity
|
|||
|
||||
public function getChapters(): ?Chapters
|
||||
{
|
||||
if ($this->chapters_id !== null && $this->chapters === null) {
|
||||
if ($this->chapters_id !== null && ! $this->chapters instanceof Chapters) {
|
||||
$this->chapters = (new MediaModel('chapters'))->getMediaById($this->chapters_id);
|
||||
}
|
||||
|
||||
|
@ -357,7 +357,7 @@ class Episode extends Entity
|
|||
*/
|
||||
public function getTranscriptUrl(): ?string
|
||||
{
|
||||
if ($this->transcript !== null) {
|
||||
if ($this->transcript instanceof Transcript) {
|
||||
return $this->transcript->file_url;
|
||||
}
|
||||
|
||||
|
@ -369,7 +369,7 @@ class Episode extends Entity
|
|||
*/
|
||||
public function getChaptersFileUrl(): ?string
|
||||
{
|
||||
if ($this->chapters !== null) {
|
||||
if ($this->chapters instanceof Chapters) {
|
||||
return $this->chapters->file_url;
|
||||
}
|
||||
|
||||
|
@ -531,7 +531,7 @@ class Episode extends Entity
|
|||
public function getPublicationStatus(): string
|
||||
{
|
||||
if ($this->publication_status === null) {
|
||||
if ($this->published_at === null) {
|
||||
if (! $this->published_at instanceof Time) {
|
||||
$this->publication_status = 'not_published';
|
||||
} elseif ($this->getPodcast()->publication_status !== 'published') {
|
||||
$this->publication_status = 'with_podcast';
|
||||
|
@ -550,7 +550,7 @@ class Episode extends Entity
|
|||
*/
|
||||
public function setLocation(?Location $location = null): static
|
||||
{
|
||||
if ($location === null) {
|
||||
if (! $location instanceof Location) {
|
||||
$this->attributes['location_name'] = null;
|
||||
$this->attributes['location_geo'] = null;
|
||||
$this->attributes['location_osm'] = null;
|
||||
|
@ -578,7 +578,7 @@ class Episode extends Entity
|
|||
return null;
|
||||
}
|
||||
|
||||
if ($this->location === null) {
|
||||
if (! $this->location instanceof Location) {
|
||||
$this->location = new Location($this->location_name, $this->location_geo, $this->location_osm);
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ class Person extends Entity
|
|||
*/
|
||||
public function setAvatar(UploadedFile | File $file = null): static
|
||||
{
|
||||
if ($file === null || ($file instanceof UploadedFile && ! $file->isValid())) {
|
||||
if (! $file instanceof File || ($file instanceof UploadedFile && ! $file->isValid())) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ class Person extends Entity
|
|||
return null;
|
||||
}
|
||||
|
||||
if ($this->avatar === null) {
|
||||
if (! $this->avatar instanceof Image) {
|
||||
$this->avatar = (new MediaModel('image'))->getMediaById($this->avatar_id);
|
||||
}
|
||||
|
||||
|
|
|
@ -231,7 +231,7 @@ class Podcast extends Entity
|
|||
|
||||
public function setCover(UploadedFile | File $file = null): self
|
||||
{
|
||||
if ($file === null || ($file instanceof UploadedFile && ! $file->isValid())) {
|
||||
if (! $file instanceof File || ($file instanceof UploadedFile && ! $file->isValid())) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,7 @@ class Podcast extends Entity
|
|||
|
||||
public function setBanner(UploadedFile | File $file = null): self
|
||||
{
|
||||
if ($file === null || ($file instanceof UploadedFile && ! $file->isValid())) {
|
||||
if (! $file instanceof File || ($file instanceof UploadedFile && ! $file->isValid())) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -488,7 +488,7 @@ class Podcast extends Entity
|
|||
public function getPublicationStatus(): string
|
||||
{
|
||||
if ($this->publication_status === null) {
|
||||
if ($this->published_at === null) {
|
||||
if (! $this->published_at instanceof Time) {
|
||||
$this->publication_status = 'not_published';
|
||||
} elseif ($this->published_at->isBefore(Time::now())) {
|
||||
$this->publication_status = 'published';
|
||||
|
@ -576,7 +576,6 @@ class Podcast extends Entity
|
|||
public function getOtherCategoriesIds(): array
|
||||
{
|
||||
if ($this->other_categories_ids === null) {
|
||||
// @phpstan-ignore-next-line
|
||||
$this->other_categories_ids = array_column($this->getOtherCategories(), 'id');
|
||||
}
|
||||
|
||||
|
@ -588,7 +587,7 @@ class Podcast extends Entity
|
|||
*/
|
||||
public function setLocation(?Location $location = null): static
|
||||
{
|
||||
if ($location === null) {
|
||||
if (! $location instanceof Location) {
|
||||
$this->attributes['location_name'] = null;
|
||||
$this->attributes['location_geo'] = null;
|
||||
$this->attributes['location_osm'] = null;
|
||||
|
@ -616,7 +615,7 @@ class Podcast extends Entity
|
|||
return null;
|
||||
}
|
||||
|
||||
if ($this->location === null) {
|
||||
if (! $this->location instanceof Location) {
|
||||
$this->location = new Location($this->location_name, $this->location_geo, $this->location_osm);
|
||||
}
|
||||
|
||||
|
|
|
@ -292,7 +292,7 @@ if (! function_exists('location_link')) {
|
|||
*/
|
||||
function location_link(?Location $location, string $class = ''): string
|
||||
{
|
||||
if ($location === null) {
|
||||
if (! $location instanceof Location) {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
@ -359,14 +359,14 @@ if (! function_exists('relative_time')) {
|
|||
'request'
|
||||
)->getLocale(), IntlDateFormatter::MEDIUM, IntlDateFormatter::NONE);
|
||||
$translatedDate = $time->toLocalizedString($formatter->getPattern());
|
||||
$datetime = $time->format(DateTime::ISO8601);
|
||||
$datetime = $time->format(DateTime::ATOM);
|
||||
|
||||
return <<<HTML
|
||||
<time-ago class="{$class}" datetime="{$datetime}">
|
||||
<relative-time tense="past" class="{$class}" datetime="{$datetime}">
|
||||
<time
|
||||
datetime="{$datetime}"
|
||||
title="{$time}">{$translatedDate}</time>
|
||||
</time-ago>
|
||||
</relative-time>
|
||||
HTML;
|
||||
}
|
||||
}
|
||||
|
@ -383,17 +383,19 @@ if (! function_exists('local_datetime')) {
|
|||
$datetime = $time->format(DateTime::ISO8601);
|
||||
|
||||
return <<<HTML
|
||||
<local-time datetime="{$datetime}"
|
||||
weekday="long"
|
||||
month="long"
|
||||
<relative-time datetime="{$datetime}"
|
||||
prefix=""
|
||||
threshold="PT0S"
|
||||
weekday="long"
|
||||
day="numeric"
|
||||
month="long"
|
||||
year="numeric"
|
||||
hour="numeric"
|
||||
minute="numeric">
|
||||
<time
|
||||
datetime="{$datetime}"
|
||||
title="{$time}">{$translatedDate}</time>
|
||||
</local-time>
|
||||
</relative-time>
|
||||
HTML;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,8 +7,9 @@ declare(strict_types=1);
|
|||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||
* @link https://castopod.org/
|
||||
*/
|
||||
|
||||
use App\Entities\Episode;
|
||||
|
||||
use CodeIgniter\I18n\Time;
|
||||
use JamesHeinrich\GetID3\WriteTags;
|
||||
use Modules\Media\FileManagers\FileManagerInterface;
|
||||
|
||||
|
@ -49,7 +50,7 @@ if (! function_exists('write_audio_file_tags')) {
|
|||
: $episode->podcast->publisher,
|
||||
],
|
||||
'album' => [esc($episode->podcast->title)],
|
||||
'year' => [$episode->published_at !== null ? $episode->published_at->format('Y') : ''],
|
||||
'year' => [$episode->published_at instanceof Time ? $episode->published_at->format('Y') : ''],
|
||||
'genre' => ['Podcast'],
|
||||
'comment' => [$episode->description],
|
||||
'track_number' => [(string) $episode->number],
|
||||
|
|
|
@ -7,12 +7,15 @@ declare(strict_types=1);
|
|||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||
* @link https://castopod.org/
|
||||
*/
|
||||
|
||||
use App\Entities\Category;
|
||||
use App\Entities\Location;
|
||||
use App\Entities\Podcast;
|
||||
|
||||
use App\Libraries\SimpleRSSElement;
|
||||
use CodeIgniter\I18n\Time;
|
||||
use Config\Mimes;
|
||||
use Modules\Media\Entities\Chapters;
|
||||
use Modules\Media\Entities\Transcript;
|
||||
use Modules\PremiumPodcasts\Entities\Subscription;
|
||||
|
||||
if (! function_exists('get_rss_feed')) {
|
||||
|
@ -76,7 +79,7 @@ if (! function_exists('get_rss_feed')) {
|
|||
$itunesImage->addAttribute('href', $podcast->cover->feed_url);
|
||||
|
||||
$channel->addChild('language', $podcast->language_code);
|
||||
if ($podcast->location !== null) {
|
||||
if ($podcast->location instanceof Location) {
|
||||
$locationElement = $channel->addChild('location', $podcast->location->name, $podcastNamespace);
|
||||
if ($podcast->location->geo !== null) {
|
||||
$locationElement->addAttribute('geo', $podcast->location->geo);
|
||||
|
@ -271,7 +274,7 @@ if (! function_exists('get_rss_feed')) {
|
|||
}
|
||||
|
||||
foreach ($episodes as $episode) {
|
||||
if ($episode->is_premium && $subscription === null) {
|
||||
if ($episode->is_premium && ! $subscription instanceof Subscription) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -293,7 +296,7 @@ if (! function_exists('get_rss_feed')) {
|
|||
|
||||
$item->addChild('guid', $episode->guid);
|
||||
$item->addChild('pubDate', $episode->published_at->format(DATE_RFC1123));
|
||||
if ($episode->location !== null) {
|
||||
if ($episode->location instanceof Location) {
|
||||
$locationElement = $item->addChild('location', $episode->location->name, $podcastNamespace);
|
||||
if ($episode->location->geo !== null) {
|
||||
$locationElement->addAttribute('geo', $episode->location->geo);
|
||||
|
@ -349,7 +352,7 @@ if (! function_exists('get_rss_feed')) {
|
|||
);
|
||||
}
|
||||
|
||||
if ($episode->transcript !== null) {
|
||||
if ($episode->transcript instanceof Transcript) {
|
||||
$transcriptElement = $item->addChild('transcript', null, $podcastNamespace);
|
||||
$transcriptElement->addAttribute('url', $episode->transcript->file_url);
|
||||
$transcriptElement->addAttribute(
|
||||
|
@ -361,7 +364,7 @@ if (! function_exists('get_rss_feed')) {
|
|||
$transcriptElement->addAttribute('language', $podcast->language_code);
|
||||
}
|
||||
|
||||
if ($episode->getChapters() !== null) {
|
||||
if ($episode->getChapters() instanceof Chapters) {
|
||||
$chaptersElement = $item->addChild('chapters', null, $podcastNamespace);
|
||||
$chaptersElement->addAttribute('url', $episode->chapters->file_url);
|
||||
$chaptersElement->addAttribute('type', 'application/json+chapters');
|
||||
|
@ -422,12 +425,12 @@ if (! function_exists('add_category_tag')) {
|
|||
$itunesCategory = $node->addChild('category', null, $itunesNamespace);
|
||||
$itunesCategory->addAttribute(
|
||||
'text',
|
||||
$category->parent !== null
|
||||
$category->parent instanceof Category
|
||||
? $category->parent->apple_category
|
||||
: $category->apple_category,
|
||||
);
|
||||
|
||||
if ($category->parent !== null) {
|
||||
if ($category->parent instanceof Category) {
|
||||
$itunesCategoryChild = $itunesCategory->addChild('category', null, $itunesNamespace);
|
||||
$itunesCategoryChild->addAttribute('text', $category->apple_category);
|
||||
$node->addChild('category', $category->parent->apple_category);
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
use App\Entities\Actor;
|
||||
|
||||
use App\Entities\Episode;
|
||||
use App\Entities\EpisodeComment;
|
||||
use App\Entities\Page;
|
||||
|
@ -11,6 +12,7 @@ use App\Entities\Post;
|
|||
use Melbahja\Seo\MetaTags;
|
||||
use Melbahja\Seo\Schema;
|
||||
use Melbahja\Seo\Schema\Thing;
|
||||
use Modules\Fediverse\Entities\PreviewCard;
|
||||
|
||||
/**
|
||||
* @copyright 2021 Ad Aures
|
||||
|
@ -157,7 +159,7 @@ if (! function_exists('get_post_metatags')) {
|
|||
'name' => $post->episode->podcast->owner_name,
|
||||
]),
|
||||
]));
|
||||
} elseif ($post->preview_card !== null) {
|
||||
} elseif ($post->preview_card instanceof PreviewCard) {
|
||||
$socialMediaPosting->__set('sharedContent', new Thing('WebPage', [
|
||||
'headline' => $post->preview_card->title,
|
||||
'url' => $post->preview_card->url,
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace MediaClipper;
|
|||
use App\Entities\Episode;
|
||||
use Exception;
|
||||
use GdImage;
|
||||
use Modules\Media\Entities\Transcript;
|
||||
use Modules\Media\FileManagers\FileManagerInterface;
|
||||
|
||||
/**
|
||||
|
@ -116,7 +117,7 @@ class VideoClipper
|
|||
|
||||
public function subtitlesClip(): void
|
||||
{
|
||||
if ($this->episode->transcript === null) {
|
||||
if (! $this->episode->transcript instanceof Transcript) {
|
||||
throw new Exception('Episode does not have a transcript!');
|
||||
}
|
||||
|
||||
|
|
|
@ -10,8 +10,12 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Libraries;
|
||||
|
||||
use App\Entities\Actor;
|
||||
use App\Entities\Episode;
|
||||
use CodeIgniter\I18n\Time;
|
||||
use Modules\Fediverse\Core\ObjectType;
|
||||
use Modules\Media\Entities\Chapters;
|
||||
use Modules\Media\Entities\Transcript;
|
||||
|
||||
class PodcastEpisode extends ObjectType
|
||||
{
|
||||
|
@ -70,21 +74,21 @@ class PodcastEpisode extends ObjectType
|
|||
],
|
||||
];
|
||||
|
||||
if ($episode->transcript !== null) {
|
||||
if ($episode->transcript instanceof Transcript) {
|
||||
$this->audio['transcript'] = $episode->transcript->file_url;
|
||||
}
|
||||
|
||||
if ($episode->chapters !== null) {
|
||||
if ($episode->chapters instanceof Chapters) {
|
||||
$this->audio['chapters'] = $episode->chapters->file_url;
|
||||
}
|
||||
|
||||
$this->comments = url_to('episode-comments', $episode->podcast->handle, $episode->slug);
|
||||
|
||||
if ($episode->published_at !== null) {
|
||||
if ($episode->published_at instanceof Time) {
|
||||
$this->published = $episode->published_at->format(DATE_W3C);
|
||||
}
|
||||
|
||||
if ($episode->podcast->actor !== null) {
|
||||
if ($episode->podcast->actor instanceof Actor) {
|
||||
$this->attributedTo = $episode->podcast->actor->uri;
|
||||
|
||||
if ($episode->podcast->actor->followers_url) {
|
||||
|
|
|
@ -29,7 +29,7 @@ class SimpleRSSElement extends SimpleXMLElement
|
|||
$newChild = parent::addChild($name, null, $namespace);
|
||||
$node = dom_import_simplexml($newChild);
|
||||
$no = $node->ownerDocument;
|
||||
if ($no !== null) {
|
||||
if ($no instanceof DOMDocument) {
|
||||
$node->appendChild($no->createCDATASection($value));
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class Decorator implements ViewDecoratorInterface
|
|||
*/
|
||||
private static function factory(): ComponentRenderer
|
||||
{
|
||||
if (self::$components === null) {
|
||||
if (! self::$components instanceof ComponentRenderer) {
|
||||
self::$components = new ComponentRenderer();
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ class CategoryModel extends Model
|
|||
$categories,
|
||||
static function (array $result, Category $category): array {
|
||||
$result[$category->id] = '';
|
||||
if ($category->parent !== null) {
|
||||
if ($category->parent instanceof Category) {
|
||||
$result[$category->id] = lang(
|
||||
'Podcast.category_options.' . $category->parent->code,
|
||||
[],
|
||||
|
|
|
@ -10,6 +10,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Entities\Actor;
|
||||
use App\Entities\Podcast;
|
||||
use CodeIgniter\HTTP\URI;
|
||||
use CodeIgniter\Model;
|
||||
|
@ -361,7 +362,7 @@ class PodcastModel extends Model
|
|||
cache()
|
||||
->deleteMatching('user*podcasts');
|
||||
|
||||
if ($podcast !== null) {
|
||||
if ($podcast instanceof Podcast) {
|
||||
// delete cache all podcast pages
|
||||
cache()
|
||||
->deleteMatching("page_podcast#{$podcast->id}*");
|
||||
|
@ -436,7 +437,7 @@ class PodcastModel extends Model
|
|||
{
|
||||
$podcast = (new self())->getPodcastById(is_array($data['id']) ? $data['id'][0] : $data['id']);
|
||||
|
||||
if ($podcast !== null) {
|
||||
if ($podcast instanceof Podcast) {
|
||||
$podcastActor = (new ActorModel())->find($podcast->actor_id);
|
||||
|
||||
if ($podcastActor) {
|
||||
|
@ -459,11 +460,11 @@ class PodcastModel extends Model
|
|||
{
|
||||
$podcast = (new self())->getPodcastById(is_array($data['id']) ? $data['id'][0] : $data['id']);
|
||||
|
||||
if ($podcast !== null) {
|
||||
if ($podcast instanceof Podcast) {
|
||||
$actorModel = new ActorModel();
|
||||
$actor = $actorModel->getActorById($podcast->actor_id);
|
||||
|
||||
if ($actor !== null) {
|
||||
if ($actor instanceof Actor) {
|
||||
// update values
|
||||
$actor->display_name = $podcast->title;
|
||||
$actor->summary = $podcast->description_html;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import "@github/markdown-toolbar-element";
|
||||
import "@github/time-elements";
|
||||
import "@github/relative-time-element";
|
||||
import "./modules/audio-clipper";
|
||||
import ClientTimezone from "./modules/ClientTimezone";
|
||||
import Clipboard from "./modules/Clipboard";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import "@github/time-elements";
|
||||
import "@github/relative-time-element";
|
||||
import SidebarToggler from "./modules/SidebarToggler";
|
||||
import Time from "./modules/Time";
|
||||
import Toggler from "./modules/Toggler";
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"james-heinrich/getid3": "^2.0.0-beta5",
|
||||
"whichbrowser/parser": "^v2.1.7",
|
||||
"geoip2/geoip2": "v2.13.0",
|
||||
"league/commonmark": "^2.3.9",
|
||||
"league/commonmark": "^2.4.0",
|
||||
"vlucas/phpdotenv": "v5.5.0",
|
||||
"league/html-to-markdown": "^v5.1.0",
|
||||
"opawg/user-agents-php": "^v1.0",
|
||||
|
@ -24,15 +24,15 @@
|
|||
"chrisjean/php-ico": "^1.0.4",
|
||||
"melbahja/seo": "^v2.1.1",
|
||||
"codeigniter4/shield": "v1.0.0-beta.3",
|
||||
"aws/aws-sdk-php": "^3.261.17"
|
||||
"aws/aws-sdk-php": "^3.263.10"
|
||||
},
|
||||
"require-dev": {
|
||||
"mikey179/vfsstream": "^v1.6.11",
|
||||
"phpunit/phpunit": "^10.0.18",
|
||||
"captainhook/captainhook": "^5.15.5",
|
||||
"phpunit/phpunit": "^10.1.0",
|
||||
"captainhook/captainhook": "^5.16.3",
|
||||
"symplify/easy-coding-standard": "^11.3.2",
|
||||
"phpstan/phpstan": "^1.10.7",
|
||||
"rector/rector": "^0.15.23",
|
||||
"phpstan/phpstan": "^1.10.13",
|
||||
"rector/rector": "^0.15.24",
|
||||
"symplify/coding-standard": "^11.3.0"
|
||||
},
|
||||
"autoload": {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "44b79ceee12a4fe0ce58763458036267",
|
||||
"content-hash": "210cbe161bd78cbdd9a97234896b87cb",
|
||||
"packages": [
|
||||
{
|
||||
"name": "adaures/ipcat-php",
|
||||
|
@ -75,23 +75,27 @@
|
|||
},
|
||||
{
|
||||
"name": "aws/aws-crt-php",
|
||||
"version": "v1.0.4",
|
||||
"version": "v1.2.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/awslabs/aws-crt-php.git",
|
||||
"reference": "f5c64ee7c5fce196e2519b3d9b7138649efe032d"
|
||||
"reference": "1926277fc71d253dfa820271ac5987bdb193ccf5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/f5c64ee7c5fce196e2519b3d9b7138649efe032d",
|
||||
"reference": "f5c64ee7c5fce196e2519b3d9b7138649efe032d",
|
||||
"url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/1926277fc71d253dfa820271ac5987bdb193ccf5",
|
||||
"reference": "1926277fc71d253dfa820271ac5987bdb193ccf5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.8.35|^5.6.3"
|
||||
"phpunit/phpunit": "^4.8.35||^5.6.3||^9.5",
|
||||
"yoast/phpunit-polyfills": "^1.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-awscrt": "Make sure you install awscrt native extension to use any of the functionality."
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
|
@ -106,26 +110,26 @@
|
|||
}
|
||||
],
|
||||
"description": "AWS Common Runtime for PHP",
|
||||
"homepage": "http://aws.amazon.com/sdkforphp",
|
||||
"homepage": "https://github.com/awslabs/aws-crt-php",
|
||||
"keywords": ["amazon", "aws", "crt", "sdk"],
|
||||
"support": {
|
||||
"issues": "https://github.com/awslabs/aws-crt-php/issues",
|
||||
"source": "https://github.com/awslabs/aws-crt-php/tree/v1.0.4"
|
||||
"source": "https://github.com/awslabs/aws-crt-php/tree/v1.2.1"
|
||||
},
|
||||
"time": "2023-01-31T23:08:25+00:00"
|
||||
"time": "2023-03-24T20:22:19+00:00"
|
||||
},
|
||||
{
|
||||
"name": "aws/aws-sdk-php",
|
||||
"version": "3.261.17",
|
||||
"version": "3.263.10",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/aws/aws-sdk-php.git",
|
||||
"reference": "a8d2d89d79e912aa87bd2d381d34f47fbd08be65"
|
||||
"reference": "d5f40cff8fe2fe75a8415618f04c987472184eba"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/a8d2d89d79e912aa87bd2d381d34f47fbd08be65",
|
||||
"reference": "a8d2d89d79e912aa87bd2d381d34f47fbd08be65",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/d5f40cff8fe2fe75a8415618f04c987472184eba",
|
||||
"reference": "d5f40cff8fe2fe75a8415618f04c987472184eba",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -200,9 +204,9 @@
|
|||
"support": {
|
||||
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
|
||||
"issues": "https://github.com/aws/aws-sdk-php/issues",
|
||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.261.17"
|
||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.263.10"
|
||||
},
|
||||
"time": "2023-03-22T18:22:29+00:00"
|
||||
"time": "2023-04-13T18:19:56+00:00"
|
||||
},
|
||||
{
|
||||
"name": "brick/math",
|
||||
|
@ -1405,16 +1409,16 @@
|
|||
},
|
||||
{
|
||||
"name": "league/commonmark",
|
||||
"version": "2.3.9",
|
||||
"version": "2.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/thephpleague/commonmark.git",
|
||||
"reference": "c1e114f74e518daca2729ea8c4bf1167038fa4b5"
|
||||
"reference": "d44a24690f16b8c1808bf13b1bd54ae4c63ea048"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/c1e114f74e518daca2729ea8c4bf1167038fa4b5",
|
||||
"reference": "c1e114f74e518daca2729ea8c4bf1167038fa4b5",
|
||||
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/d44a24690f16b8c1808bf13b1bd54ae4c63ea048",
|
||||
"reference": "d44a24690f16b8c1808bf13b1bd54ae4c63ea048",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -1450,7 +1454,7 @@
|
|||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "2.4-dev"
|
||||
"dev-main": "2.5-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
|
@ -1505,7 +1509,7 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-02-15T14:07:24+00:00"
|
||||
"time": "2023-03-24T15:16:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/config",
|
||||
|
@ -2364,21 +2368,21 @@
|
|||
},
|
||||
{
|
||||
"name": "psr/http-client",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/http-client.git",
|
||||
"reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621"
|
||||
"reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
|
||||
"reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
|
||||
"url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31",
|
||||
"reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.0 || ^8.0",
|
||||
"psr/http-message": "^1.0"
|
||||
"psr/http-message": "^1.0 || ^2.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
|
@ -2396,34 +2400,34 @@
|
|||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
"homepage": "https://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interface for HTTP clients",
|
||||
"homepage": "https://github.com/php-fig/http-client",
|
||||
"keywords": ["http", "http-client", "psr", "psr-18"],
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/http-client/tree/master"
|
||||
"source": "https://github.com/php-fig/http-client/tree/1.0.2"
|
||||
},
|
||||
"time": "2020-06-29T06:28:15+00:00"
|
||||
"time": "2023-04-10T20:12:12+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/http-factory",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/http-factory.git",
|
||||
"reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be"
|
||||
"reference": "e616d01114759c4c489f93b099585439f795fe35"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
|
||||
"reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
|
||||
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35",
|
||||
"reference": "e616d01114759c4c489f93b099585439f795fe35",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.0.0",
|
||||
"psr/http-message": "^1.0"
|
||||
"psr/http-message": "^1.0 || ^2.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
|
@ -2441,7 +2445,7 @@
|
|||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
"homepage": "https://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interfaces for PSR-7 HTTP message factories",
|
||||
|
@ -2456,31 +2460,31 @@
|
|||
"response"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/http-factory/tree/master"
|
||||
"source": "https://github.com/php-fig/http-factory/tree/1.0.2"
|
||||
},
|
||||
"time": "2019-04-30T12:38:16+00:00"
|
||||
"time": "2023-04-10T20:10:41+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/http-message",
|
||||
"version": "1.0.1",
|
||||
"version": "1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/http-message.git",
|
||||
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
|
||||
"reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
|
||||
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
|
||||
"url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
|
||||
"reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
"php": "^7.2 || ^8.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
"dev-master": "1.1.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
|
@ -2507,9 +2511,9 @@
|
|||
"response"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/http-message/tree/master"
|
||||
"source": "https://github.com/php-fig/http-message/tree/1.1"
|
||||
},
|
||||
"time": "2016-08-06T14:39:51+00:00"
|
||||
"time": "2023-04-04T09:50:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
|
@ -3176,16 +3180,16 @@
|
|||
"packages-dev": [
|
||||
{
|
||||
"name": "captainhook/captainhook",
|
||||
"version": "5.15.5",
|
||||
"version": "5.16.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/captainhookphp/captainhook.git",
|
||||
"reference": "7fb1c78586ea58ec4118c2d4db35c9d5da3fabb0"
|
||||
"reference": "ed0279fd108aa4729b7843633b99326826c6fd76"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/captainhookphp/captainhook/zipball/7fb1c78586ea58ec4118c2d4db35c9d5da3fabb0",
|
||||
"reference": "7fb1c78586ea58ec4118c2d4db35c9d5da3fabb0",
|
||||
"url": "https://api.github.com/repos/captainhookphp/captainhook/zipball/ed0279fd108aa4729b7843633b99326826c6fd76",
|
||||
"reference": "ed0279fd108aa4729b7843633b99326826c6fd76",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -3195,7 +3199,7 @@
|
|||
"php": ">=7.4",
|
||||
"sebastianfeldmann/camino": "^0.9.2",
|
||||
"sebastianfeldmann/cli": "^3.3",
|
||||
"sebastianfeldmann/git": "^3.8.6",
|
||||
"sebastianfeldmann/git": "^3.8.9",
|
||||
"symfony/console": "^2.7 || ^3.0 || ^4.0 || ^5.0 || ^6.0",
|
||||
"symfony/filesystem": "^2.7 || ^3.0 || ^4.0 || ^5.0 || ^6.0",
|
||||
"symfony/process": "^2.7 || ^3.0 || ^4.0 || ^5.0 || ^6.0"
|
||||
|
@ -3243,7 +3247,7 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/captainhookphp/captainhook/issues",
|
||||
"source": "https://github.com/captainhookphp/captainhook/tree/5.15.5"
|
||||
"source": "https://github.com/captainhookphp/captainhook/tree/5.16.3"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -3251,7 +3255,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2023-03-20T10:35:30+00:00"
|
||||
"time": "2023-03-30T16:40:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "composer/pcre",
|
||||
|
@ -3593,16 +3597,16 @@
|
|||
},
|
||||
{
|
||||
"name": "friendsofphp/php-cs-fixer",
|
||||
"version": "v3.15.1",
|
||||
"version": "v3.16.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
|
||||
"reference": "d48755372a113bddb99f749e34805d83f3acfe04"
|
||||
"reference": "d40f9436e1c448d309fa995ab9c14c5c7a96f2dc"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d48755372a113bddb99f749e34805d83f3acfe04",
|
||||
"reference": "d48755372a113bddb99f749e34805d83f3acfe04",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d40f9436e1c448d309fa995ab9c14c5c7a96f2dc",
|
||||
"reference": "d40f9436e1c448d309fa995ab9c14c5c7a96f2dc",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -3673,7 +3677,7 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.15.1"
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.16.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -3681,7 +3685,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2023-03-13T23:26:30+00:00"
|
||||
"time": "2023-04-02T19:30:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mikey179/vfsstream",
|
||||
|
@ -3935,16 +3939,16 @@
|
|||
},
|
||||
{
|
||||
"name": "phpstan/phpstan",
|
||||
"version": "1.10.7",
|
||||
"version": "1.10.13",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpstan/phpstan.git",
|
||||
"reference": "b10ceb526d9607903c5b2673f1fc8775dbe48975"
|
||||
"reference": "f07bf8c6980b81bf9e49d44bd0caf2e737614a70"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/b10ceb526d9607903c5b2673f1fc8775dbe48975",
|
||||
"reference": "b10ceb526d9607903c5b2673f1fc8775dbe48975",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/f07bf8c6980b81bf9e49d44bd0caf2e737614a70",
|
||||
"reference": "f07bf8c6980b81bf9e49d44bd0caf2e737614a70",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -3983,20 +3987,20 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-03-16T15:24:20+00:00"
|
||||
"time": "2023-04-12T19:29:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
"version": "10.0.2",
|
||||
"version": "10.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
||||
"reference": "20800e84296ea4732f9a125e08ce86b4004ae3e4"
|
||||
"reference": "fc4f5ee614fa82d50ecf9014b51af0a9561f3df8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/20800e84296ea4732f9a125e08ce86b4004ae3e4",
|
||||
"reference": "20800e84296ea4732f9a125e08ce86b4004ae3e4",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/fc4f5ee614fa82d50ecf9014b51af0a9561f3df8",
|
||||
"reference": "fc4f5ee614fa82d50ecf9014b51af0a9561f3df8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -4024,7 +4028,7 @@
|
|||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "10.0-dev"
|
||||
"dev-main": "10.1-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
|
@ -4044,7 +4048,8 @@
|
|||
"keywords": ["coverage", "testing", "xunit"],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
|
||||
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.0.2"
|
||||
"security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
|
||||
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -4052,7 +4057,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2023-03-06T13:00:19+00:00"
|
||||
"time": "2023-04-13T07:08:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-file-iterator",
|
||||
|
@ -4272,16 +4277,16 @@
|
|||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
"version": "10.0.18",
|
||||
"version": "10.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "582563ed2edc62d1455cdbe00ea49fe09428eef3"
|
||||
"reference": "5a477aea03e61329132935689ae2d73f418f5e25"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/582563ed2edc62d1455cdbe00ea49fe09428eef3",
|
||||
"reference": "582563ed2edc62d1455cdbe00ea49fe09428eef3",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5a477aea03e61329132935689ae2d73f418f5e25",
|
||||
"reference": "5a477aea03e61329132935689ae2d73f418f5e25",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -4295,7 +4300,7 @@
|
|||
"phar-io/manifest": "^2.0.3",
|
||||
"phar-io/version": "^3.0.2",
|
||||
"php": ">=8.1",
|
||||
"phpunit/php-code-coverage": "^10.0",
|
||||
"phpunit/php-code-coverage": "^10.1",
|
||||
"phpunit/php-file-iterator": "^4.0",
|
||||
"phpunit/php-invoker": "^4.0",
|
||||
"phpunit/php-text-template": "^3.0",
|
||||
|
@ -4319,7 +4324,7 @@
|
|||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "10.0-dev"
|
||||
"dev-main": "10.1-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
|
@ -4341,7 +4346,7 @@
|
|||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
||||
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
|
||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/10.0.18"
|
||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/10.1.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -4357,7 +4362,7 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-03-22T06:15:31+00:00"
|
||||
"time": "2023-04-14T05:15:09+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/container",
|
||||
|
@ -4412,16 +4417,16 @@
|
|||
},
|
||||
{
|
||||
"name": "rector/rector",
|
||||
"version": "0.15.23",
|
||||
"version": "0.15.24",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/rectorphp/rector.git",
|
||||
"reference": "f4984ebd62b3613002869b0ddd6868261d62819e"
|
||||
"reference": "716473919bcfdc27bdd2a32afb72adbf4c224e59"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/rectorphp/rector/zipball/f4984ebd62b3613002869b0ddd6868261d62819e",
|
||||
"reference": "f4984ebd62b3613002869b0ddd6868261d62819e",
|
||||
"url": "https://api.github.com/repos/rectorphp/rector/zipball/716473919bcfdc27bdd2a32afb72adbf4c224e59",
|
||||
"reference": "716473919bcfdc27bdd2a32afb72adbf4c224e59",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -4450,7 +4455,7 @@
|
|||
"keywords": ["automation", "dev", "migration", "refactoring"],
|
||||
"support": {
|
||||
"issues": "https://github.com/rectorphp/rector/issues",
|
||||
"source": "https://github.com/rectorphp/rector/tree/0.15.23"
|
||||
"source": "https://github.com/rectorphp/rector/tree/0.15.24"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -4458,7 +4463,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2023-03-22T15:22:45+00:00"
|
||||
"time": "2023-04-05T08:49:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/cli-parser",
|
||||
|
@ -4796,16 +4801,16 @@
|
|||
},
|
||||
{
|
||||
"name": "sebastian/environment",
|
||||
"version": "6.0.0",
|
||||
"version": "6.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/environment.git",
|
||||
"reference": "b6f3694c6386c7959915a0037652e0c40f6f69cc"
|
||||
"reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/b6f3694c6386c7959915a0037652e0c40f6f69cc",
|
||||
"reference": "b6f3694c6386c7959915a0037652e0c40f6f69cc",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/43c751b41d74f96cbbd4e07b7aec9675651e2951",
|
||||
"reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -4839,7 +4844,8 @@
|
|||
"keywords": ["Xdebug", "environment", "hhvm"],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/environment/issues",
|
||||
"source": "https://github.com/sebastianbergmann/environment/tree/6.0.0"
|
||||
"security": "https://github.com/sebastianbergmann/environment/security/policy",
|
||||
"source": "https://github.com/sebastianbergmann/environment/tree/6.0.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -4847,7 +4853,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2023-02-03T07:03:04+00:00"
|
||||
"time": "2023-04-11T05:39:26+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/exporter",
|
||||
|
@ -5398,16 +5404,16 @@
|
|||
},
|
||||
{
|
||||
"name": "sebastianfeldmann/git",
|
||||
"version": "3.8.6",
|
||||
"version": "3.8.9",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianfeldmann/git.git",
|
||||
"reference": "d4ce674cf5104a162f8401033d88ea7f47134c5d"
|
||||
"reference": "38586be69b0932b630337afcc8db12e5b7981254"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianfeldmann/git/zipball/d4ce674cf5104a162f8401033d88ea7f47134c5d",
|
||||
"reference": "d4ce674cf5104a162f8401033d88ea7f47134c5d",
|
||||
"url": "https://api.github.com/repos/sebastianfeldmann/git/zipball/38586be69b0932b630337afcc8db12e5b7981254",
|
||||
"reference": "38586be69b0932b630337afcc8db12e5b7981254",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -5443,7 +5449,7 @@
|
|||
"keywords": ["git"],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianfeldmann/git/issues",
|
||||
"source": "https://github.com/sebastianfeldmann/git/tree/3.8.6"
|
||||
"source": "https://github.com/sebastianfeldmann/git/tree/3.8.9"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -5451,20 +5457,20 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2023-02-24T21:21:52+00:00"
|
||||
"time": "2023-03-30T16:37:34+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
"version": "v6.2.7",
|
||||
"version": "v6.2.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/console.git",
|
||||
"reference": "cbad09eb8925b6ad4fb721c7a179344dc4a19d45"
|
||||
"reference": "3582d68a64a86ec25240aaa521ec8bc2342b369b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/cbad09eb8925b6ad4fb721c7a179344dc4a19d45",
|
||||
"reference": "cbad09eb8925b6ad4fb721c7a179344dc4a19d45",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/3582d68a64a86ec25240aaa521ec8bc2342b369b",
|
||||
"reference": "3582d68a64a86ec25240aaa521ec8bc2342b369b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -5520,9 +5526,9 @@
|
|||
],
|
||||
"description": "Eases the creation of beautiful and testable command line interfaces",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": ["cli", "command line", "console", "terminal"],
|
||||
"keywords": ["cli", "command-line", "console", "terminal"],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/console/tree/v6.2.7"
|
||||
"source": "https://github.com/symfony/console/tree/v6.2.8"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -5538,20 +5544,20 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-02-25T17:00:03+00:00"
|
||||
"time": "2023-03-29T21:42:15+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/event-dispatcher",
|
||||
"version": "v6.2.7",
|
||||
"version": "v6.2.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/event-dispatcher.git",
|
||||
"reference": "404b307de426c1c488e5afad64403e5f145e82a5"
|
||||
"reference": "04046f35fd7d72f9646e721fc2ecb8f9c67d3339"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/404b307de426c1c488e5afad64403e5f145e82a5",
|
||||
"reference": "404b307de426c1c488e5afad64403e5f145e82a5",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/04046f35fd7d72f9646e721fc2ecb8f9c67d3339",
|
||||
"reference": "04046f35fd7d72f9646e721fc2ecb8f9c67d3339",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -5601,7 +5607,7 @@
|
|||
"description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/event-dispatcher/tree/v6.2.7"
|
||||
"source": "https://github.com/symfony/event-dispatcher/tree/v6.2.8"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -5617,7 +5623,7 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-02-14T08:44:56+00:00"
|
||||
"time": "2023-03-20T16:06:02+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/event-dispatcher-contracts",
|
||||
|
@ -6099,16 +6105,16 @@
|
|||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
"version": "v6.2.7",
|
||||
"version": "v6.2.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/process.git",
|
||||
"reference": "680e8a2ea6b3f87aecc07a6a65a203ae573d1902"
|
||||
"reference": "75ed64103df4f6615e15a7fe38b8111099f47416"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/680e8a2ea6b3f87aecc07a6a65a203ae573d1902",
|
||||
"reference": "680e8a2ea6b3f87aecc07a6a65a203ae573d1902",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/75ed64103df4f6615e15a7fe38b8111099f47416",
|
||||
"reference": "75ed64103df4f6615e15a7fe38b8111099f47416",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -6136,7 +6142,7 @@
|
|||
"description": "Executes commands in sub-processes",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/process/tree/v6.2.7"
|
||||
"source": "https://github.com/symfony/process/tree/v6.2.8"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -6152,7 +6158,7 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-02-24T10:42:00+00:00"
|
||||
"time": "2023-03-09T16:20:02+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/service-contracts",
|
||||
|
@ -6295,16 +6301,16 @@
|
|||
},
|
||||
{
|
||||
"name": "symfony/string",
|
||||
"version": "v6.2.7",
|
||||
"version": "v6.2.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/string.git",
|
||||
"reference": "67b8c1eec78296b85dc1c7d9743830160218993d"
|
||||
"reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/string/zipball/67b8c1eec78296b85dc1c7d9743830160218993d",
|
||||
"reference": "67b8c1eec78296b85dc1c7d9743830160218993d",
|
||||
"url": "https://api.github.com/repos/symfony/string/zipball/193e83bbd6617d6b2151c37fff10fa7168ebddef",
|
||||
"reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -6348,7 +6354,7 @@
|
|||
"homepage": "https://symfony.com",
|
||||
"keywords": ["grapheme", "i18n", "string", "unicode", "utf-8", "utf8"],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/string/tree/v6.2.7"
|
||||
"source": "https://github.com/symfony/string/tree/v6.2.8"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -6364,7 +6370,7 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-02-24T10:42:00+00:00"
|
||||
"time": "2023-03-20T16:06:02+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symplify/coding-standard",
|
||||
|
|
|
@ -22,6 +22,8 @@ use App\Models\PostModel;
|
|||
use CodeIgniter\Exceptions\PageNotFoundException;
|
||||
use CodeIgniter\HTTP\RedirectResponse;
|
||||
use CodeIgniter\I18n\Time;
|
||||
use Modules\Media\Entities\Chapters;
|
||||
use Modules\Media\Entities\Transcript;
|
||||
use Modules\Media\Models\MediaModel;
|
||||
|
||||
class EpisodeController extends BaseController
|
||||
|
@ -33,7 +35,7 @@ class EpisodeController extends BaseController
|
|||
public function _remap(string $method, string ...$params): mixed
|
||||
{
|
||||
if (
|
||||
($podcast = (new PodcastModel())->getPodcastById((int) $params[0])) === null
|
||||
! ($podcast = (new PodcastModel())->getPodcastById((int) $params[0])) instanceof Podcast
|
||||
) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
@ -359,7 +361,7 @@ class EpisodeController extends BaseController
|
|||
} elseif ($chaptersChoice === 'remote-url') {
|
||||
if (
|
||||
($chaptersRemoteUrl = $this->request->getPost('chapters_remote_url')) &&
|
||||
(($chaptersFile = $this->episode->chapters) !== null)
|
||||
(($chaptersFile = $this->episode->chapters) instanceof Chapters)
|
||||
) {
|
||||
(new MediaModel())->deleteMedia($this->episode->chapters);
|
||||
}
|
||||
|
@ -408,7 +410,7 @@ class EpisodeController extends BaseController
|
|||
|
||||
public function transcriptDelete(): RedirectResponse
|
||||
{
|
||||
if ($this->episode->transcript === null) {
|
||||
if (! $this->episode->transcript instanceof Transcript) {
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
|
@ -425,7 +427,7 @@ class EpisodeController extends BaseController
|
|||
|
||||
public function chaptersDelete(): RedirectResponse
|
||||
{
|
||||
if ($this->episode->chapters === null) {
|
||||
if (! $this->episode->chapters instanceof Chapters) {
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
|
@ -626,7 +628,7 @@ class EpisodeController extends BaseController
|
|||
|
||||
$post = (new PostModel())->getPostById($this->request->getPost('post_id'));
|
||||
|
||||
if ($post !== null) {
|
||||
if ($post instanceof Post) {
|
||||
$post->message = $this->request->getPost('message');
|
||||
$post->published_at = $this->episode->published_at;
|
||||
|
||||
|
@ -883,7 +885,7 @@ class EpisodeController extends BaseController
|
|||
->with('errors', $this->validator->getErrors());
|
||||
}
|
||||
|
||||
if ($this->episode->published_at !== null) {
|
||||
if ($this->episode->published_at instanceof Time) {
|
||||
return redirect()
|
||||
->back()
|
||||
->withInput()
|
||||
|
|
|
@ -28,7 +28,7 @@ class NotificationController extends BaseController
|
|||
public function _remap(string $method, string ...$params): mixed
|
||||
{
|
||||
if (
|
||||
($podcast = (new PodcastModel())->getPodcastById((int) $params[0])) === null
|
||||
! ($podcast = (new PodcastModel())->getPodcastById((int) $params[0])) instanceof Podcast
|
||||
) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ class PersonController extends BaseController
|
|||
}
|
||||
|
||||
if (
|
||||
($this->person = (new PersonModel())->getPersonById((int) $params[0])) !== null
|
||||
($this->person = (new PersonModel())->getPersonById((int) $params[0])) instanceof Person
|
||||
) {
|
||||
return $this->{$method}();
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\Admin\Controllers;
|
||||
|
||||
use App\Entities\Actor;
|
||||
use App\Entities\Location;
|
||||
use App\Entities\Podcast;
|
||||
use App\Entities\Post;
|
||||
|
@ -45,7 +46,7 @@ class PodcastController extends BaseController
|
|||
}
|
||||
|
||||
if (
|
||||
($podcast = (new PodcastModel())->getPodcastById((int) $params[0])) !== null
|
||||
($podcast = (new PodcastModel())->getPodcastById((int) $params[0])) instanceof Podcast
|
||||
) {
|
||||
$this->podcast = $podcast;
|
||||
return $this->{$method}();
|
||||
|
@ -419,7 +420,7 @@ class PodcastController extends BaseController
|
|||
// remove banner url from actor
|
||||
$actor = (new ActorModel())->getActorById($this->podcast->actor_id);
|
||||
|
||||
if ($actor !== null) {
|
||||
if ($actor instanceof Actor) {
|
||||
$actor->cover_image_url = null;
|
||||
$actor->cover_image_mimetype = null;
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ use AdAures\PodcastPersonsTaxonomy\ReversedTaxonomy;
|
|||
use App\Entities\Episode;
|
||||
use App\Entities\Location;
|
||||
use App\Entities\Person;
|
||||
use App\Entities\Platform;
|
||||
use App\Entities\Podcast;
|
||||
use App\Models\CategoryModel;
|
||||
use App\Models\EpisodeModel;
|
||||
|
@ -36,7 +37,7 @@ class PodcastImportController extends BaseController
|
|||
return $this->{$method}();
|
||||
}
|
||||
|
||||
if (($this->podcast = (new PodcastModel())->getPodcastById((int) $params[0])) !== null) {
|
||||
if (($this->podcast = (new PodcastModel())->getPodcastById((int) $params[0])) instanceof Podcast) {
|
||||
return $this->{$method}();
|
||||
}
|
||||
|
||||
|
@ -232,7 +233,7 @@ class PodcastImportController extends BaseController
|
|||
foreach ($platformType['elements'] as $platform) {
|
||||
$platformLabel = $platform->attributes()['platform'];
|
||||
$platformSlug = slugify((string) $platformLabel);
|
||||
if ($platformModel->getPlatform($platformSlug) !== null) {
|
||||
if ($platformModel->getPlatform($platformSlug) instanceof Platform) {
|
||||
$podcastsPlatformsData[] = [
|
||||
'platform_slug' => $platformSlug,
|
||||
'podcast_id' => $newPodcastId,
|
||||
|
@ -252,7 +253,7 @@ class PodcastImportController extends BaseController
|
|||
$fullName = (string) $podcastPerson;
|
||||
$personModel = new PersonModel();
|
||||
$newPersonId = null;
|
||||
if (($newPerson = $personModel->getPerson($fullName)) !== null) {
|
||||
if (($newPerson = $personModel->getPerson($fullName)) instanceof Person) {
|
||||
$newPersonId = $newPerson->id;
|
||||
} else {
|
||||
$newPodcastPerson = new Person([
|
||||
|
@ -412,7 +413,7 @@ class PodcastImportController extends BaseController
|
|||
$fullName = (string) $episodePerson;
|
||||
$personModel = new PersonModel();
|
||||
$newPersonId = null;
|
||||
if (($newPerson = $personModel->getPerson($fullName)) !== null) {
|
||||
if (($newPerson = $personModel->getPerson($fullName)) instanceof Person) {
|
||||
$newPersonId = $newPerson->id;
|
||||
} else {
|
||||
$newPerson = new Person([
|
||||
|
@ -648,7 +649,7 @@ class PodcastImportController extends BaseController
|
|||
$fullName = (string) $episodePerson;
|
||||
$personModel = new PersonModel();
|
||||
$newPersonId = null;
|
||||
if (($newPerson = $personModel->getPerson($fullName)) !== null) {
|
||||
if (($newPerson = $personModel->getPerson($fullName)) instanceof Person) {
|
||||
$newPersonId = $newPerson->id;
|
||||
} else {
|
||||
$newPerson = new Person([
|
||||
|
|
|
@ -27,7 +27,7 @@ class PodcastPersonController extends BaseController
|
|||
}
|
||||
|
||||
if (
|
||||
($this->podcast = (new PodcastModel())->getPodcastById((int) $params[0])) !== null
|
||||
($this->podcast = (new PodcastModel())->getPodcastById((int) $params[0])) instanceof Podcast
|
||||
) {
|
||||
unset($params[0]);
|
||||
return $this->{$method}(...$params);
|
||||
|
|
|
@ -28,7 +28,7 @@ class PodcastPlatformController extends BaseController
|
|||
}
|
||||
|
||||
if (
|
||||
($this->podcast = (new PodcastModel())->getPodcastById((int) $params[0])) !== null
|
||||
($this->podcast = (new PodcastModel())->getPodcastById((int) $params[0])) instanceof Podcast
|
||||
) {
|
||||
unset($params[0]);
|
||||
return $this->{$method}(...$params);
|
||||
|
|
|
@ -29,7 +29,7 @@ class SoundbiteController extends BaseController
|
|||
public function _remap(string $method, string ...$params): mixed
|
||||
{
|
||||
if (
|
||||
($podcast = (new PodcastModel())->getPodcastById((int) $params[0])) === null
|
||||
! ($podcast = (new PodcastModel())->getPodcastById((int) $params[0])) instanceof Podcast
|
||||
) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ use App\Models\EpisodeModel;
|
|||
use App\Models\PodcastModel;
|
||||
use CodeIgniter\Exceptions\PageNotFoundException;
|
||||
use CodeIgniter\HTTP\RedirectResponse;
|
||||
use Modules\Media\Entities\Transcript;
|
||||
use Modules\Media\Models\MediaModel;
|
||||
|
||||
class VideoClipsController extends BaseController
|
||||
|
@ -29,7 +30,7 @@ class VideoClipsController extends BaseController
|
|||
public function _remap(string $method, string ...$params): mixed
|
||||
{
|
||||
if (
|
||||
($podcast = (new PodcastModel())->getPodcastById((int) $params[0])) === null
|
||||
! ($podcast = (new PodcastModel())->getPodcastById((int) $params[0])) instanceof Podcast
|
||||
) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
@ -124,7 +125,7 @@ class VideoClipsController extends BaseController
|
|||
'ffmpeg' => $ffmpeg !== null,
|
||||
'gd' => extension_loaded('gd'),
|
||||
'freetype' => extension_loaded('gd') && gd_info()['FreeType Support'],
|
||||
'transcript' => $this->episode->transcript !== null,
|
||||
'transcript' => $this->episode->transcript instanceof Transcript,
|
||||
];
|
||||
|
||||
if (in_array(false, $checks, true)) {
|
||||
|
|
|
@ -30,7 +30,7 @@ class ContributorController extends BaseController
|
|||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
if (($podcast = (new PodcastModel())->getPodcastById((int) $params[0])) === null) {
|
||||
if (! ($podcast = (new PodcastModel())->getPodcastById((int) $params[0])) instanceof Podcast) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ class ContributorController extends BaseController
|
|||
if (($this->contributor = (new UserModel())->getPodcastContributor(
|
||||
(int) $params[1],
|
||||
(int) $params[0]
|
||||
)) !== null) {
|
||||
)) instanceof User) {
|
||||
return $this->{$method}();
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\Auth\Filters;
|
||||
|
||||
use App\Entities\Podcast;
|
||||
use App\Models\PodcastModel;
|
||||
use CodeIgniter\Filters\FilterInterface;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
|
@ -50,7 +51,7 @@ class PermissionFilter implements FilterInterface
|
|||
$podcastId = (int) $routerParams[0];
|
||||
} else {
|
||||
$podcast = (new PodcastModel())->getPodcastByHandle($routerParams[0]);
|
||||
if ($podcast !== null) {
|
||||
if ($podcast instanceof Podcast) {
|
||||
$podcastId = $podcast->id;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ class ActorController extends Controller
|
|||
]);
|
||||
}
|
||||
|
||||
if ($reply !== null) {
|
||||
if ($reply instanceof Post) {
|
||||
$postId = model('PostModel', false)
|
||||
->addReply($reply, true, false);
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ class Activity extends UuidEntity
|
|||
throw new RuntimeException('Activity must have an actor_id before getting the actor.');
|
||||
}
|
||||
|
||||
if ($this->actor === null) {
|
||||
if (! $this->actor instanceof Actor) {
|
||||
$this->actor = model('ActorModel', false)
|
||||
->getActorById($this->actor_id);
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ class Activity extends UuidEntity
|
|||
throw new RuntimeException('Activity must have a target_actor_id before getting the target actor.');
|
||||
}
|
||||
|
||||
if ($this->target_actor === null) {
|
||||
if (! $this->target_actor instanceof Actor) {
|
||||
$this->target_actor = model('ActorModel', false)
|
||||
->getActorById($this->target_actor_id);
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ class Activity extends UuidEntity
|
|||
throw new RuntimeException('Activity must have a post_id before getting post.');
|
||||
}
|
||||
|
||||
if ($this->post === null) {
|
||||
if (! $this->post instanceof Post) {
|
||||
$this->post = model('PostModel', false)
|
||||
->getPostById($this->post_id);
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ class Post extends UuidEntity
|
|||
throw new RuntimeException('Post must have an actor_id before getting actor.');
|
||||
}
|
||||
|
||||
if ($this->actor === null) {
|
||||
if (! $this->actor instanceof Actor) {
|
||||
$this->actor = model('ActorModel', false)
|
||||
->getActorById($this->actor_id);
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ class Post extends UuidEntity
|
|||
throw new RuntimeException('Post must be created before getting preview_card.');
|
||||
}
|
||||
|
||||
if ($this->preview_card === null) {
|
||||
if (! $this->preview_card instanceof PreviewCard) {
|
||||
$this->preview_card = model('PreviewCardModel', false)
|
||||
->getPostPreviewCard($this->id);
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ class Post extends UuidEntity
|
|||
throw new RuntimeException('Post is not a reply.');
|
||||
}
|
||||
|
||||
if ($this->reply_to_post === null) {
|
||||
if (! $this->reply_to_post instanceof self) {
|
||||
$this->reply_to_post = model('PostModel', false)
|
||||
->getPostById($this->in_reply_to_id);
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ class Post extends UuidEntity
|
|||
throw new RuntimeException('Post is not a reblog.');
|
||||
}
|
||||
|
||||
if ($this->reblog_of_post === null) {
|
||||
if (! $this->reblog_of_post instanceof self) {
|
||||
$this->reblog_of_post = model('PostModel', false)
|
||||
->getPostById($this->reblog_of_id);
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ class HttpSignature
|
|||
|
||||
public function __construct(IncomingRequest $request = null)
|
||||
{
|
||||
if ($request === null) {
|
||||
if (! $request instanceof IncomingRequest) {
|
||||
$request = Services::request();
|
||||
}
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ class ActorModel extends BaseModel
|
|||
*/
|
||||
public function isActorBlocked(string $actorUri): bool
|
||||
{
|
||||
if (($actor = $this->getActorByUri($actorUri)) !== null) {
|
||||
if (($actor = $this->getActorByUri($actorUri)) instanceof Actor) {
|
||||
return $actor->is_blocked;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ class OrderedCollectionObject extends ObjectType
|
|||
) {
|
||||
$this->id = current_url();
|
||||
|
||||
if ($pager !== null) {
|
||||
if ($pager instanceof Pager) {
|
||||
$totalItems = $pager->getTotal();
|
||||
$this->totalItems = $totalItems;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ class LockController extends BaseController
|
|||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
if (($podcast = (new PodcastModel())->getPodcastByHandle($params[0])) === null) {
|
||||
if (! ($podcast = (new PodcastModel())->getPodcastByHandle($params[0])) instanceof Podcast) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ class SubscriptionController extends BaseController
|
|||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
if (($podcast = (new PodcastModel())->getPodcastById((int) $params[0])) === null) {
|
||||
if (! ($podcast = (new PodcastModel())->getPodcastById((int) $params[0])) instanceof Podcast) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,9 @@ class SubscriptionController extends BaseController
|
|||
return $this->{$method}();
|
||||
}
|
||||
|
||||
if (($this->subscription = (new SubscriptionModel())->getSubscriptionById((int) $params[1])) === null) {
|
||||
if (! ($this->subscription = (new SubscriptionModel())->getSubscriptionById(
|
||||
(int) $params[1]
|
||||
)) instanceof Subscription) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
|
|
51
package.json
51
package.json
|
@ -33,12 +33,12 @@
|
|||
"@codemirror/lang-xml": "^6.0.2",
|
||||
"@codemirror/language": "^6.6.0",
|
||||
"@codemirror/state": "^6.2.0",
|
||||
"@codemirror/view": "^6.9.3",
|
||||
"@floating-ui/dom": "^1.2.5",
|
||||
"@codemirror/view": "^6.9.4",
|
||||
"@floating-ui/dom": "^1.2.6",
|
||||
"@github/clipboard-copy-element": "^1.1.2",
|
||||
"@github/hotkey": "^2.0.1",
|
||||
"@github/markdown-toolbar-element": "^2.1.1",
|
||||
"@github/time-elements": "^4.0.0",
|
||||
"@github/relative-time-element": "^4.2.4",
|
||||
"@tailwindcss/nesting": "0.0.0-insiders.565cd3e",
|
||||
"@vime/core": "^5.4.0",
|
||||
"choices.js": "^10.2.0",
|
||||
|
@ -46,52 +46,53 @@
|
|||
"flatpickr": "^4.6.13",
|
||||
"leaflet": "^1.9.3",
|
||||
"leaflet.markercluster": "^1.5.3",
|
||||
"lit": "^2.7.0",
|
||||
"lit": "^2.7.2",
|
||||
"marked": "^4.3.0",
|
||||
"wavesurfer.js": "^6.6.1",
|
||||
"wavesurfer.js": "^6.6.3",
|
||||
"xml-formatter": "^3.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^17.5.0",
|
||||
"@commitlint/config-conventional": "^17.4.4",
|
||||
"@semantic-release/changelog": "^6.0.2",
|
||||
"@commitlint/cli": "^17.6.1",
|
||||
"@commitlint/config-conventional": "^17.6.1",
|
||||
"@csstools/css-tokenizer": "^2.1.1",
|
||||
"@semantic-release/changelog": "^6.0.3",
|
||||
"@semantic-release/exec": "^6.0.3",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"@semantic-release/gitlab": "^11.0.1",
|
||||
"@semantic-release/gitlab": "^12.0.1",
|
||||
"@tailwindcss/forms": "^0.5.3",
|
||||
"@tailwindcss/line-clamp": "^0.4.2",
|
||||
"@tailwindcss/line-clamp": "^0.4.4",
|
||||
"@tailwindcss/typography": "^0.5.9",
|
||||
"@types/leaflet": "^1.9.3",
|
||||
"@types/marked": "^4.0.8",
|
||||
"@types/wavesurfer.js": "^6.0.3",
|
||||
"@typescript-eslint/eslint-plugin": "^5.56.0",
|
||||
"@typescript-eslint/parser": "^5.56.0",
|
||||
"@types/wavesurfer.js": "^6.0.4",
|
||||
"@typescript-eslint/eslint-plugin": "^5.58.0",
|
||||
"@typescript-eslint/parser": "^5.58.0",
|
||||
"all-contributors-cli": "^6.24.0",
|
||||
"commitizen": "^4.3.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"cssnano": "^5.1.15",
|
||||
"cssnano": "^6.0.0",
|
||||
"cz-conventional-changelog": "^3.3.0",
|
||||
"eslint": "^8.36.0",
|
||||
"eslint": "^8.38.0",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"husky": "^8.0.3",
|
||||
"is-ci": "^3.0.1",
|
||||
"lint-staged": "^13.2.0",
|
||||
"lint-staged": "^13.2.1",
|
||||
"postcss": "^8.4.21",
|
||||
"postcss-import": "^15.1.0",
|
||||
"postcss-nesting": "^11.2.1",
|
||||
"postcss-preset-env": "^8.0.1",
|
||||
"postcss-nesting": "^11.2.2",
|
||||
"postcss-preset-env": "^8.3.1",
|
||||
"postcss-reporter": "^7.0.5",
|
||||
"prettier": "2.8.6",
|
||||
"prettier": "2.8.7",
|
||||
"prettier-plugin-organize-imports": "^3.2.2",
|
||||
"semantic-release": "^20.1.3",
|
||||
"stylelint": "^15.3.0",
|
||||
"stylelint-config-standard": "^31.0.0",
|
||||
"semantic-release": "^21.0.1",
|
||||
"stylelint": "^15.4.0",
|
||||
"stylelint-config-standard": "^32.0.0",
|
||||
"svgo": "^3.0.2",
|
||||
"tailwindcss": "^3.2.7",
|
||||
"typescript": "^5.0.2",
|
||||
"tailwindcss": "^3.3.1",
|
||||
"typescript": "^5.0.4",
|
||||
"vite": "^4.2.1",
|
||||
"vite-plugin-pwa": "^0.14.5",
|
||||
"vite-plugin-pwa": "^0.14.7",
|
||||
"workbox-build": "^6.5.4",
|
||||
"workbox-core": "^6.5.4",
|
||||
"workbox-routing": "^6.5.4",
|
||||
|
|
1619
pnpm-lock.yaml
1619
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue