diff --git a/app/Config/Toolbar.php b/app/Config/Toolbar.php index 30a1d4b0..e1806d6c 100644 --- a/app/Config/Toolbar.php +++ b/app/Config/Toolbar.php @@ -37,8 +37,7 @@ class Toolbar extends BaseConfig */ public array $collectors = [ Timers::class, - // TODO: uncomment when fixed: https://github.com/codeigniter4/CodeIgniter4/issues/5539 - // Database::class, + Database::class, Logs::class, Views::class, // Cache::class, diff --git a/app/Entities/EpisodeComment.php b/app/Entities/EpisodeComment.php index da10e9e7..9160a020 100644 --- a/app/Entities/EpisodeComment.php +++ b/app/Entities/EpisodeComment.php @@ -87,18 +87,22 @@ class EpisodeComment extends UuidEntity /** * Returns the comment's actor + * + * @noRector ReturnTypeDeclarationRector */ - public function getActor(): Actor + public function getActor(): ?Actor { if ($this->actor_id === null) { throw new RuntimeException('Comment must have an actor_id before getting actor.'); } if ($this->actor === null) { + // @phpstan-ignore-next-line $this->actor = model(ActorModel::class, false) ->getActorById($this->actor_id); } + // @phpstan-ignore-next-line return $this->actor; } @@ -123,6 +127,9 @@ class EpisodeComment extends UuidEntity return $this->getReplies() !== []; } + /** + * @noRector ReturnTypeDeclarationRector + */ public function getReplyToComment(): ?self { if ($this->in_reply_to_id === null) { diff --git a/app/Entities/Podcast.php b/app/Entities/Podcast.php index e46335d7..7d13531d 100644 --- a/app/Entities/Podcast.php +++ b/app/Entities/Podcast.php @@ -182,17 +182,22 @@ class Podcast extends Entity 'updated_by' => 'integer', ]; - public function getActor(): Actor + /** + * @noRector ReturnTypeDeclarationRector + */ + public function getActor(): ?Actor { if ($this->actor_id === 0) { throw new RuntimeException('Podcast must have an actor_id before getting actor.'); } if ($this->actor === null) { + // @phpstan-ignore-next-line $this->actor = model(ActorModel::class) ->getActorById($this->actor_id); } + // @phpstan-ignore-next-line return $this->actor; } diff --git a/composer.lock b/composer.lock index 309a845a..33552eab 100644 --- a/composer.lock +++ b/composer.lock @@ -106,12 +106,12 @@ "source": { "type": "git", "url": "https://github.com/codeigniter4/CodeIgniter4.git", - "reference": "0755553a4259fbacc799395ca8a5546c5e979c45" + "reference": "8449d13724d460a4e5573f49027cd9f862449a29" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/codeigniter4/CodeIgniter4/zipball/0755553a4259fbacc799395ca8a5546c5e979c45", - "reference": "0755553a4259fbacc799395ca8a5546c5e979c45", + "url": "https://api.github.com/repos/codeigniter4/CodeIgniter4/zipball/8449d13724d460a4e5573f49027cd9f862449a29", + "reference": "8449d13724d460a4e5573f49027cd9f862449a29", "shasum": "" }, "require": { @@ -134,7 +134,7 @@ "phpstan/phpstan": "^1.0", "phpunit/phpunit": "^9.1", "predis/predis": "^1.1", - "rector/rector": "0.12.10" + "rector/rector": "0.12.11" }, "suggest": { "ext-fileinfo": "Improves mime type detection for files" @@ -155,6 +155,7 @@ "autoload-dev": { "psr-4": { "CodeIgniter\\": "tests/system/", + "CodeIgniter\\AutoReview\\": "tests/AutoReview/", "Utils\\": "utils/" } }, @@ -183,7 +184,7 @@ "slack": "https://codeigniterchat.slack.com", "issues": "https://github.com/codeigniter4/CodeIgniter4/issues" }, - "time": "2022-01-04T07:11:09+00:00" + "time": "2022-01-10T01:36:11+00:00" }, { "name": "codeigniter4/settings", diff --git a/phpstan.neon b/phpstan.neon index 74274597..88db3cf6 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -30,7 +30,6 @@ parameters: - '#Function "property_exists\(\)" cannot be used/left in the code#' - '#Instead of "instanceof/is_a\(\)" use ReflectionProvider service or "\(new ObjectType\(\)\)\-\>isSuperTypeOf\(\)" for static reflection to work#' - '#^Access to an undefined property App\\Entities\\Media\\Image#' - - '#^Call to an undefined method CodeIgniter\\Model#' - '#^Access to an undefined property CodeIgniter\\Database\\BaseBuilder#' - message: '#Function "function_exists\(\)" cannot be used/left in the code#'