phpstan fixes

This commit is contained in:
Dennis Eichhorn 2020-11-27 22:56:16 +01:00
parent d76ec5aa9f
commit 06a6117bb8
2 changed files with 4 additions and 29 deletions

View File

@ -174,7 +174,7 @@ final class ApiController extends Controller
) {
/** @var \Modules\Comments\Controller\ApiController $commentApi */
$commnetList = $commentApi->createCommentList();
$newsArticle->setCommentList($commnetList);
$newsArticle->comments = $commnetList;
}
if (!empty($tags = $request->getDataJson('tags'))) {

View File

@ -17,6 +17,7 @@ namespace Modules\News\Models;
use Modules\Admin\Models\Account;
use Modules\Admin\Models\NullAccount;
use Modules\Tag\Models\Tag;
use Modules\Comments\Models\CommentList;
use phpOMS\Contract\ArrayableInterface;
use phpOMS\Localization\ISO639x1Enum;
use phpOMS\Stdlib\Base\Exception\InvalidEnumValue;
@ -130,10 +131,10 @@ class NewsArticle implements \JsonSerializable, ArrayableInterface
/**
* Comments
*
* @var null|\Modules\Comments\Models\CommentList
* @var null|CommentList
* @since 1.0.0
*/
private $comments = null;
public ?CommentList $comments = null;
/**
* Constructor.
@ -147,32 +148,6 @@ class NewsArticle implements \JsonSerializable, ArrayableInterface
$this->publish = new \DateTime('now');
}
/**
* Set comment list
*
* @param int|\Modules\Comments\Models\CommentList $comments Comment list
*
* @return void
*
* @since 1.0.0
*/
public function setCommentList($comments) : void
{
$this->comments = $comments;
}
/**
* Get comments
*
* @return null|\Modules\Comments\Models\CommentList
*
* @since 1.0.0
*/
public function getComments()
{
return $this->comments;
}
/**
* Get id
*