From e393d03bd02f4f4d9952b60cffe7fc4ab70597b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bar=C3=A1=C5=A1ek?= Date: Thu, 6 May 2021 10:57:26 +0200 Subject: [PATCH] Fix CodeFactor --- src/Post.php | 20 ++++++++++++++------ src/WordpressPostFeedExtension.php | 6 +++--- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/Post.php b/src/Post.php index 7519f86..4ed0120 100644 --- a/src/Post.php +++ b/src/Post.php @@ -9,6 +9,14 @@ class Post { private ?ImageStorage $imageStorage = null; + private string $title; + + private string $description; + + private string $link; + + private \DateTimeImmutable $date; + private ?string $creator = null; /** @var string[] */ @@ -17,12 +25,12 @@ class Post private ?string $mainImageUrl = null; - public function __construct( - private string $title, - private string $description, - private string $link, - private \DateTimeImmutable $date - ) { + public function __construct(string $title, string $description, string $link, \DateTimeImmutable $date) + { + $this->title = $title; + $this->description = $description; + $this->link = $link; + $this->date = $date; } diff --git a/src/WordpressPostFeedExtension.php b/src/WordpressPostFeedExtension.php index ad611cb..d913a83 100644 --- a/src/WordpressPostFeedExtension.php +++ b/src/WordpressPostFeedExtension.php @@ -25,7 +25,7 @@ public function getConfigSchema(): Schema public function beforeCompile(): void { $builder = $this->getContainerBuilder(); - /** @var mixed[] $config */ + /** @var array $config */ $config = $this->getConfig(); $builder->addDefinition($this->prefix('feed')) @@ -41,8 +41,8 @@ public function beforeCompile(): void /** - * @param mixed[] $config - * @param mixed[] $parameters + * @param array $config + * @param array $parameters * @return string[] */ private function resolveImageStoragePath(array $config, array $parameters): array