diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 44fa834e..1fd510e7 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM php:latest +FROM php:7.2-fpm COPY --from=composer /usr/bin/composer /usr/bin/composer diff --git a/Dockerfile b/Dockerfile index 279e6783..d4003c49 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM php:latest +FROM php:7.2-fpm COPY . /castopod WORKDIR /castopod diff --git a/app/Config/Routes.php b/app/Config/Routes.php index e288b15e..f65494dd 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -287,7 +287,7 @@ $routes->group( $routes->get('forgot', 'AuthController::forgotPassword', [ 'as' => 'forgot', ]); - $routes->post('forgot', 'Auth::attemptForgot'); + $routes->post('forgot', 'AuthController::attemptForgot'); $routes->get('reset-password', 'AuthController::resetPassword', [ 'as' => 'reset-password', ]); diff --git a/app/Controllers/Admin/Contributor.php b/app/Controllers/Admin/Contributor.php index 2f8ed6d5..def6ab68 100644 --- a/app/Controllers/Admin/Contributor.php +++ b/app/Controllers/Admin/Contributor.php @@ -14,8 +14,15 @@ use App\Models\UserModel; class Contributor extends BaseController { - protected \App\Entities\Podcast $podcast; - protected ?\App\Entities\User $user; + /** + * @var \App\Entities\Podcast + */ + protected $podcast; + + /** + * @var \App\Entities\User|null + */ + protected $user; public function _remap($method, ...$params) { diff --git a/app/Controllers/Admin/Episode.php b/app/Controllers/Admin/Episode.php index b639512e..d1bc612c 100644 --- a/app/Controllers/Admin/Episode.php +++ b/app/Controllers/Admin/Episode.php @@ -13,8 +13,15 @@ use App\Models\PodcastModel; class Episode extends BaseController { - protected \App\Entities\Podcast $podcast; - protected ?\App\Entities\Episode $episode; + /** + * @var \App\Entities\Podcast + */ + protected $podcast; + + /** + * @var \App\Entities\Episode|null + */ + protected $episode; public function _remap($method, ...$params) { diff --git a/app/Controllers/Admin/Podcast.php b/app/Controllers/Admin/Podcast.php index c0e5b2cb..3b18f44b 100644 --- a/app/Controllers/Admin/Podcast.php +++ b/app/Controllers/Admin/Podcast.php @@ -15,7 +15,10 @@ use Config\Services; class Podcast extends BaseController { - protected ?\App\Entities\Podcast $podcast; + /** + * @var \App\Entities\Podcast|null + */ + protected $podcast; public function _remap($method, ...$params) { diff --git a/app/Controllers/Admin/User.php b/app/Controllers/Admin/User.php index 872d973f..52528c67 100644 --- a/app/Controllers/Admin/User.php +++ b/app/Controllers/Admin/User.php @@ -14,7 +14,10 @@ use Config\Services; class User extends BaseController { - protected ?\App\Entities\User $user; + /** + * @var \App\Entities\User|null + */ + protected $user; public function _remap($method, ...$params) { diff --git a/app/Controllers/Episode.php b/app/Controllers/Episode.php index d3fc965f..657a161d 100644 --- a/app/Controllers/Episode.php +++ b/app/Controllers/Episode.php @@ -13,8 +13,15 @@ use App\Models\PodcastModel; class Episode extends BaseController { - protected \App\Entities\Podcast $podcast; - protected ?\App\Entities\Episode $episode; + /** + * @var \App\Entities\Podcast + */ + protected $podcast; + + /** + * @var \App\Entities\Episode|null + */ + protected $episode; public function _remap($method, ...$params) { diff --git a/app/Controllers/Podcast.php b/app/Controllers/Podcast.php index 90d04bc8..d867540d 100644 --- a/app/Controllers/Podcast.php +++ b/app/Controllers/Podcast.php @@ -12,7 +12,10 @@ use App\Models\PodcastModel; class Podcast extends BaseController { - protected ?\App\Entities\Podcast $podcast; + /** + * @var \App\Entities\Podcast|null + */ + protected $podcast; public function _remap($method, ...$params) { diff --git a/app/Entities/Category.php b/app/Entities/Category.php index 688b561c..aa1e32d9 100644 --- a/app/Entities/Category.php +++ b/app/Entities/Category.php @@ -13,6 +13,9 @@ use CodeIgniter\Entity; class Category extends Entity { + /** + * @var \App\Entity\Category|null + */ protected $parent; protected $casts = [ diff --git a/app/Entities/Episode.php b/app/Entities/Episode.php index 0bf553fa..f60a5244 100644 --- a/app/Entities/Episode.php +++ b/app/Entities/Episode.php @@ -14,17 +14,60 @@ use League\CommonMark\CommonMarkConverter; class Episode extends Entity { - protected \App\Entities\Podcast $podcast; - protected string $GUID; - protected string $link; - protected \CodeIgniter\Files\File $image; - protected string $image_media_path; - protected string $image_url; - protected \CodeIgniter\Files\File $enclosure; - protected string $enclosure_media_path; - protected string $enclosure_url; - protected array $enclosure_metadata; - protected string $description_html; + /** + * @var \App\Entities\Podcast + */ + protected $podcast; + + /** + * @var string + */ + protected $GUID; + + /** + * @var string + */ + protected $link; + + /** + * @var \CodeIgniter\Files\File + */ + protected $image; + + /** + * @var string + */ + protected $image_media_path; + + /** + * @var string + */ + protected $image_url; + + /** + * @var \CodeIgniter\Files\File + */ + protected $enclosure; + + /** + * @var string + */ + protected $enclosure_media_path; + + /** + * @var string + */ + protected $enclosure_url; + + /** + * @var array + */ + protected $enclosure_metadata; + + /** + * @var string + */ + protected $description_html; protected $casts = [ 'slug' => 'string', diff --git a/app/Entities/Podcast.php b/app/Entities/Podcast.php index 4ee1bf9b..cb4040fe 100644 --- a/app/Entities/Podcast.php +++ b/app/Entities/Podcast.php @@ -15,14 +15,45 @@ use League\CommonMark\CommonMarkConverter; class Podcast extends Entity { - protected string $link; - protected \CodeIgniter\Files\File $image; - protected string $image_media_path; - protected string $image_url; + /** + * @var string + */ + protected $link; + + /** + * @var \CodeIgniter\Files\File + */ + protected $image; + + /** + * @var string + */ + protected $image_media_path; + + /** + * @var string + */ + protected $image_url; + + /** + * @var \App\Entities\Episode[] + */ protected $episodes; - protected \App\Entities\User $owner; + + /** + * @var + */ + protected $owner; + + /** + * @var \App\Entities\User[] + */ protected $contributors; - protected string $description_html; + + /** + * @var string + */ + protected $description_html; protected $casts = [ 'id' => 'integer', diff --git a/app/Entities/User.php b/app/Entities/User.php index 88fe6ed9..42b6d3a1 100644 --- a/app/Entities/User.php +++ b/app/Entities/User.php @@ -13,10 +13,10 @@ class User extends \Myth\Auth\Entities\User protected $podcasts = []; /** - * The podcast user is contributing to - * @var \App\Entities\Podcast + * The podcast the user is contributing to + * @var \App\Entities\Podcast|null */ - protected $podcast; + protected $podcast = null; /** * Array of field names and the type of value to cast them as @@ -49,6 +49,11 @@ class User extends \Myth\Auth\Entities\User return $this->podcasts; } + /** + * Returns a podcast the user is contributing to + * + * @return \App\Entities\Podcast + */ public function getPodcast() { if (empty($this->podcast_id)) {