diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 44fa834e0305790c0deb871814f0b8071d4bb612..1fd510e768854e1706973fb72a16f8ae31620962 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 279e67839a1b64d3898b40f290e130ebe2f77e2d..d4003c49463ab25b9fba48260f64e8118823b004 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 e288b15e2e497157f97331aa3a90941de637b205..f65494dde758f3c5ef5c529b99fabc600e9fd26f 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 2f8ed6d5f46a3554193510a46f900326281240b1..def6ab688a5ce95980d7e4db2cf34a832b8cda35 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 b639512ef16e95b5eb07c2827aae69b0a60e020d..d1bc612cbbf53650d9d67d8d5c83486b8993a4fa 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 c0e5b2cb33adb0eb56e29c75ddc2e48a7ea770d7..3b18f44bf0a4b472480d9599feacf98f3ed2c40c 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 872d973ff82707e03e4cb408720a235b9ca5099d..52528c6734fadafaec5c2b5965048999217b8ffc 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 d3fc965f8494eaf9bc8fa90daae77684c5e33c56..657a161d1cff6eca8be91da0baf7f0b73f3b9cff 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 90d04bc85dcef1f455dbbaa52e39e3840420d704..d867540d013ba7a4d722ba99a5bba43d29bc02b7 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 688b561c0a69e048b38a5fcd7b59d6e2730ea325..aa1e32d9a0561d197f1be69aca073ef3c993621b 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 0bf553fad1de15eb6c6c1762d8a5cb7e90676fb4..f60a5244808b8c061059dce8963ec41e0ded92f1 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 4ee1bf9b6952b3d39d0919f77fb04d291c185a51..cb4040fe33e4a13e78528c671ec5424558d235fb 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 88fe6ed9621c106d00650832b9a5b09e17e93706..42b6d3a17f8908fcbf1681f57d93aab8aef2c0a0 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)) {