mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-15 20:47:46 +02:00
refactor: add phpstan and update code to adhere to level 5
- move and refactor Image.php from Libraries to Entities folder - update some database field names / types - update composer packages
This commit is contained in:
parent
b691b927fe
commit
231d578d64
148 changed files with 11189 additions and 11421 deletions
|
|
@ -8,10 +8,16 @@
|
|||
|
||||
namespace App\Entities;
|
||||
|
||||
use ActivityPub\Entities\Note as ActivityPubNote;
|
||||
use App\Models\ActorModel;
|
||||
use App\Models\EpisodeModel;
|
||||
use RuntimeException;
|
||||
|
||||
class Note extends \ActivityPub\Entities\Note
|
||||
/**
|
||||
* @property int|null $episode_id
|
||||
* @property Episode|null $episode
|
||||
*/
|
||||
class Note extends ActivityPubNote
|
||||
{
|
||||
/**
|
||||
* @var Episode|null
|
||||
|
|
@ -40,13 +46,13 @@ class Note extends \ActivityPub\Entities\Note
|
|||
*/
|
||||
public function getEpisode()
|
||||
{
|
||||
if (empty($this->episode_id)) {
|
||||
if ($this->episode_id === null) {
|
||||
throw new RuntimeException(
|
||||
'Note must have an episode_id before getting episode.',
|
||||
);
|
||||
}
|
||||
|
||||
if (empty($this->episode)) {
|
||||
if ($this->episode === null) {
|
||||
$this->episode = (new EpisodeModel())->getEpisodeById(
|
||||
$this->episode_id,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue