chore: update CI to v4.6.3 + all php and js dependencies

This commit is contained in:
Yassine Doghri 2025-08-25 18:09:41 +00:00
commit 346c00e7b5
206 changed files with 6239 additions and 5336 deletions

View file

@ -33,8 +33,10 @@ class CreditsController extends BaseController
'content_markdown' => '',
]);
$allPodcasts = (new PodcastModel())->findAll();
$allCredits = (new CreditModel())->findAll();
$allPodcasts = new PodcastModel()
->findAll();
$allCredits = new CreditModel()
->findAll();
// Unlike the carpenter, we make a tree from a table:
$personGroup = null;

View file

@ -65,7 +65,7 @@ class EpisodeAudioController extends Controller
}
if (
! ($podcast = (new PodcastModel())->getPodcastByHandle($params[0])) instanceof Podcast
! ($podcast = new PodcastModel()->getPodcastByHandle($params[0])) instanceof Podcast
) {
throw PageNotFoundException::forPageNotFound();
}
@ -73,7 +73,7 @@ class EpisodeAudioController extends Controller
$this->podcast = $podcast;
if (
! ($episode = (new EpisodeModel())->getEpisodeBySlug($params[0], $params[1])) instanceof Episode
! ($episode = new EpisodeModel()->getEpisodeBySlug($params[0], $params[1])) instanceof Episode
) {
throw PageNotFoundException::forPageNotFound();
}
@ -108,7 +108,7 @@ 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,
)) instanceof Subscription) {

View file

@ -44,7 +44,7 @@ class EpisodeCommentController extends BaseController
}
if (
! ($podcast = (new PodcastModel())->getPodcastByHandle($params[0])) instanceof Podcast
! ($podcast = new PodcastModel()->getPodcastByHandle($params[0])) instanceof Podcast
) {
throw PageNotFoundException::forPageNotFound();
}
@ -53,7 +53,7 @@ class EpisodeCommentController extends BaseController
$this->actor = $podcast->actor;
if (
! ($episode = (new EpisodeModel())->getEpisodeBySlug($params[0], $params[1])) instanceof Episode
! ($episode = new EpisodeModel()->getEpisodeBySlug($params[0], $params[1])) instanceof Episode
) {
throw PageNotFoundException::forPageNotFound();
}
@ -61,7 +61,7 @@ class EpisodeCommentController extends BaseController
$this->episode = $episode;
if (
! ($comment = (new EpisodeCommentModel())->getCommentById($params[2])) instanceof EpisodeComment
! ($comment = new EpisodeCommentModel()->getCommentById($params[2])) instanceof EpisodeComment
) {
throw PageNotFoundException::forPageNotFound();
}

View file

@ -41,7 +41,7 @@ class EpisodeController extends BaseController
}
if (
! ($podcast = (new PodcastModel())->getPodcastByHandle($params[0])) instanceof Podcast
! ($podcast = new PodcastModel()->getPodcastByHandle($params[0])) instanceof Podcast
) {
throw PageNotFoundException::forPageNotFound();
}
@ -49,7 +49,7 @@ class EpisodeController extends BaseController
$this->podcast = $podcast;
if (
! ($episode = (new EpisodeModel())->getEpisodeBySlug($params[0], $params[1])) instanceof Episode
! ($episode = new EpisodeModel()->getEpisodeBySlug($params[0], $params[1])) instanceof Episode
) {
throw PageNotFoundException::forPageNotFound();
}
@ -87,9 +87,8 @@ class EpisodeController extends BaseController
'episode' => $this->episode,
];
$secondsToNextUnpublishedEpisode = (new EpisodeModel())->getSecondsToNextUnpublishedEpisode(
$this->podcast->id,
);
$secondsToNextUnpublishedEpisode = new EpisodeModel()
->getSecondsToNextUnpublishedEpisode($this->podcast->id);
if (auth()->loggedIn()) {
helper('form');
@ -133,9 +132,8 @@ class EpisodeController extends BaseController
'episode' => $this->episode,
];
$secondsToNextUnpublishedEpisode = (new EpisodeModel())->getSecondsToNextUnpublishedEpisode(
$this->podcast->id,
);
$secondsToNextUnpublishedEpisode = new EpisodeModel()
->getSecondsToNextUnpublishedEpisode($this->podcast->id);
if (auth()->loggedIn()) {
helper('form');
@ -189,9 +187,8 @@ class EpisodeController extends BaseController
$data['chapters'] = $chapters;
}
$secondsToNextUnpublishedEpisode = (new EpisodeModel())->getSecondsToNextUnpublishedEpisode(
$this->podcast->id,
);
$secondsToNextUnpublishedEpisode = new EpisodeModel()
->getSecondsToNextUnpublishedEpisode($this->podcast->id);
if (auth()->loggedIn()) {
helper('form');
@ -250,9 +247,8 @@ class EpisodeController extends BaseController
}
}
$secondsToNextUnpublishedEpisode = (new EpisodeModel())->getSecondsToNextUnpublishedEpisode(
$this->podcast->id,
);
$secondsToNextUnpublishedEpisode = new EpisodeModel()
->getSecondsToNextUnpublishedEpisode($this->podcast->id);
if (auth()->loggedIn()) {
helper('form');
@ -306,9 +302,8 @@ class EpisodeController extends BaseController
'themeData' => $themeData,
];
$secondsToNextUnpublishedEpisode = (new EpisodeModel())->getSecondsToNextUnpublishedEpisode(
$this->podcast->id,
);
$secondsToNextUnpublishedEpisode = new EpisodeModel()
->getSecondsToNextUnpublishedEpisode($this->podcast->id);
// The page cache is set to a decade so it is deleted manually upon podcast update
return view('embed', $data, [
@ -410,7 +405,7 @@ class EpisodeController extends BaseController
$orderedItems = [];
if ($paginatedComments !== null) {
foreach ($paginatedComments as $comment) {
$orderedItems[] = (new NoteObject($comment))->toArray();
$orderedItems[] = new NoteObject($comment)->toArray();
}
}

View file

@ -26,7 +26,8 @@ class EpisodePreviewController extends BaseController
}
// find episode by previewUUID
$episode = (new EpisodeModel())->getEpisodeByPreviewId($params[0]);
$episode = new EpisodeModel()
->getEpisodeByPreviewId($params[0]);
if (! $episode instanceof Episode) {
throw PageNotFoundException::forPageNotFound();

View file

@ -33,7 +33,8 @@ class FeedController extends Controller
public function index(string $podcastHandle): ResponseInterface
{
$podcast = (new PodcastModel())->where('handle', $podcastHandle)
$podcast = new PodcastModel()
->where('handle', $podcastHandle)
->first();
if (! $podcast instanceof Podcast) {
throw PageNotFoundException::forPageNotFound();
@ -68,7 +69,8 @@ class FeedController extends Controller
$subscription = null;
$token = $this->request->getGet('token');
if ($token) {
$subscription = (new SubscriptionModel())->validateSubscription($podcastHandle, $token);
$subscription = new SubscriptionModel()
->validateSubscription($podcastHandle, $token);
}
$cacheName = implode(
@ -85,9 +87,8 @@ class FeedController extends Controller
$found = get_rss_feed($podcast, $serviceSlug, $subscription, $token);
// The page cache is set to expire after next episode publication or a decade by default so it is deleted manually upon podcast update
$secondsToNextUnpublishedEpisode = (new EpisodeModel())->getSecondsToNextUnpublishedEpisode(
$podcast->id,
);
$secondsToNextUnpublishedEpisode = new EpisodeModel()
->getSecondsToNextUnpublishedEpisode($podcast->id);
cache()
->save($cacheName, $found, $secondsToNextUnpublishedEpisode ?: DECADE);

View file

@ -25,7 +25,8 @@ class HomeController extends BaseController
'sort',
) : 'activity';
$allPodcasts = (new PodcastModel())->getAllPodcasts($sortBy);
$allPodcasts = new PodcastModel()
->getAllPodcasts($sortBy);
// check if there's only one podcast to redirect user to it
if (count($allPodcasts) === 1) {

View file

@ -43,7 +43,7 @@ class MapController extends BaseController
{
$cacheName = 'episodes_markers';
if (! ($found = cache($cacheName))) {
$episodes = (new EpisodeModel())
$episodes = new EpisodeModel()
->where('`published_at` <= UTC_TIMESTAMP()', null, false)
->where('location_geo is not', null)
->findAll();

View file

@ -24,7 +24,8 @@ class PageController extends BaseController
throw PageNotFoundException::forPageNotFound();
}
$page = (new PageModel())->where('slug', $params[0])->first();
$page = new PageModel()
->where('slug', $params[0])->first();
if (! $page instanceof Page) {
throw PageNotFoundException::forPageNotFound();
}

View file

@ -35,7 +35,7 @@ class PodcastController extends BaseController
}
if (
! ($podcast = (new PodcastModel())->getPodcastByHandle($params[0])) instanceof Podcast
! ($podcast = new PodcastModel()->getPodcastByHandle($params[0])) instanceof Podcast
) {
throw PageNotFoundException::forPageNotFound();
}
@ -78,7 +78,8 @@ class PodcastController extends BaseController
set_podcast_metatags($this->podcast, 'activity');
$data = [
'podcast' => $this->podcast,
'posts' => (new PostModel())->getActorPublishedPosts($this->podcast->actor_id),
'posts' => new PostModel()
->getActorPublishedPosts($this->podcast->actor_id),
];
// if user is logged in then send to the authenticated activity view
@ -88,9 +89,8 @@ class PodcastController extends BaseController
return view('podcast/activity', $data);
}
$secondsToNextUnpublishedEpisode = (new EpisodeModel())->getSecondsToNextUnpublishedEpisode(
$this->podcast->id,
);
$secondsToNextUnpublishedEpisode = new EpisodeModel()
->getSecondsToNextUnpublishedEpisode($this->podcast->id);
return view('podcast/activity', $data, [
'cache' => $secondsToNextUnpublishedEpisode ?: DECADE,
@ -120,7 +120,8 @@ class PodcastController extends BaseController
);
if (! ($cachedView = cache($cacheName))) {
$stats = (new EpisodeModel())->getPodcastStats($this->podcast->id);
$stats = new EpisodeModel()
->getPodcastStats($this->podcast->id);
set_podcast_metatags($this->podcast, 'about');
$data = [
@ -135,9 +136,8 @@ class PodcastController extends BaseController
return view('podcast/about', $data);
}
$secondsToNextUnpublishedEpisode = (new EpisodeModel())->getSecondsToNextUnpublishedEpisode(
$this->podcast->id,
);
$secondsToNextUnpublishedEpisode = new EpisodeModel()
->getSecondsToNextUnpublishedEpisode($this->podcast->id);
return view('podcast/about', $data, [
'cache' => $secondsToNextUnpublishedEpisode ?: DECADE,
@ -156,7 +156,8 @@ class PodcastController extends BaseController
$seasonQuery = $this->request->getGet('season');
if (! $yearQuery && ! $seasonQuery) {
$defaultQuery = (new PodcastModel())->getDefaultQuery($this->podcast->id);
$defaultQuery = new PodcastModel()
->getDefaultQuery($this->podcast->id);
if ($defaultQuery) {
if ($defaultQuery['type'] === 'season') {
$seasonQuery = $defaultQuery['data']['season_number'];
@ -241,21 +242,16 @@ class PodcastController extends BaseController
'podcast' => $this->podcast,
'episodesNav' => $episodesNavigation,
'activeQuery' => $activeQuery,
'episodes' => (new EpisodeModel())->getPodcastEpisodes(
$this->podcast->id,
$this->podcast->type,
$yearQuery,
$seasonQuery,
),
'episodes' => new EpisodeModel()
->getPodcastEpisodes($this->podcast->id, $this->podcast->type, $yearQuery, $seasonQuery),
];
if (auth()->loggedIn()) {
return view('podcast/episodes', $data);
}
$secondsToNextUnpublishedEpisode = (new EpisodeModel())->getSecondsToNextUnpublishedEpisode(
$this->podcast->id,
);
$secondsToNextUnpublishedEpisode = new EpisodeModel()
->getSecondsToNextUnpublishedEpisode($this->podcast->id);
return view('podcast/episodes', $data, [
'cache' => $secondsToNextUnpublishedEpisode ?: DECADE,
'cache_name' => $cacheName,
@ -291,7 +287,7 @@ class PodcastController extends BaseController
$orderedItems = [];
if ($paginatedEpisodes !== null) {
foreach ($paginatedEpisodes as $episode) {
$orderedItems[] = (new PodcastEpisode($episode))->toArray();
$orderedItems[] = new PodcastEpisode($episode)->toArray();
}
}

View file

@ -47,7 +47,7 @@ class PostController extends FediversePostController
{
if (
! ($podcast = (new PodcastModel())->getPodcastByHandle($params[0])) instanceof Podcast
! ($podcast = new PodcastModel()->getPodcastByHandle($params[0])) instanceof Podcast
) {
throw PageNotFoundException::forPageNotFound();
}
@ -62,7 +62,7 @@ class PostController extends FediversePostController
}
if (
! ($post = (new PostModel())->getPostById($params[1])) instanceof CastopodPost
! ($post = new PostModel()->getPostById($params[1])) instanceof CastopodPost
) {
throw PageNotFoundException::forPageNotFound();
}
@ -143,7 +143,7 @@ class PostController extends FediversePostController
if (
$episodeUri &&
($params = extract_params_from_episode_uri(new URI($episodeUri))) &&
($episode = (new EpisodeModel())->getEpisodeBySlug($params['podcastHandle'], $params['episodeSlug']))
($episode = new EpisodeModel()->getEpisodeBySlug($params['podcastHandle'], $params['episodeSlug']))
) {
$newPost->episode_id = $episode->id;
}
@ -216,7 +216,8 @@ class PostController extends FediversePostController
#[Override]
public function reblogAction(): RedirectResponse
{
(new PostModel())->toggleReblog(interact_as_actor(), $this->post);
new PostModel()
->toggleReblog(interact_as_actor(), $this->post);
return redirect()->back();
}

View file

@ -82,7 +82,7 @@ class WebmanifestController extends Controller
public function podcastManifest(string $podcastHandle): ResponseInterface
{
if (
! ($podcast = (new PodcastModel())->getPodcastByHandle($podcastHandle)) instanceof Podcast
! ($podcast = new PodcastModel()->getPodcastByHandle($podcastHandle)) instanceof Podcast
) {
throw PageNotFoundException::forPageNotFound();
}