mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-15 12:37:46 +02:00
refactor: fix some of phpstan's ignored errors
This commit is contained in:
parent
0de9c1ad23
commit
4c1a3e5015
67 changed files with 450 additions and 361 deletions
|
|
@ -10,10 +10,12 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Entities\Podcast;
|
||||
use App\Models\EpisodeModel;
|
||||
use App\Models\PodcastModel;
|
||||
use CodeIgniter\Controller;
|
||||
use CodeIgniter\Exceptions\PageNotFoundException;
|
||||
use CodeIgniter\HTTP\IncomingRequest;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Exception;
|
||||
use Modules\PremiumPodcasts\Entities\Subscription;
|
||||
|
|
@ -22,13 +24,20 @@ use Opawg\UserAgentsPhp\UserAgentsRSS;
|
|||
|
||||
class FeedController extends Controller
|
||||
{
|
||||
/**
|
||||
* Instance of the main Request object.
|
||||
*
|
||||
* @var IncomingRequest
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
public function index(string $podcastHandle): ResponseInterface
|
||||
{
|
||||
helper(['rss', 'premium_podcasts', 'misc']);
|
||||
|
||||
$podcast = (new PodcastModel())->where('handle', $podcastHandle)
|
||||
->first();
|
||||
if (! $podcast) {
|
||||
if (! $podcast instanceof Podcast) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue