mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-13 19:47:45 +02:00
refactor: update code base to php 8 and set phpstan lvl to 6
This commit is contained in:
parent
4a33c50fb6
commit
6b74a9e98a
124 changed files with 1810 additions and 2157 deletions
|
|
@ -9,20 +9,18 @@
|
|||
namespace App\Controllers;
|
||||
|
||||
use App\Models\PodcastModel;
|
||||
use CodeIgniter\HTTP\RedirectResponse;
|
||||
|
||||
class HomeController extends BaseController
|
||||
{
|
||||
/**
|
||||
* @return RedirectResponse|string
|
||||
*/
|
||||
public function index()
|
||||
public function index(): RedirectResponse|string
|
||||
{
|
||||
$model = new PodcastModel();
|
||||
|
||||
$allPodcasts = $model->findAll();
|
||||
|
||||
// check if there's only one podcast to redirect user to it
|
||||
if (count($allPodcasts) == 1) {
|
||||
if (count($allPodcasts) === 1) {
|
||||
return redirect()->route('podcast-activity', [
|
||||
$allPodcasts[0]->name,
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue