mirror of
https://github.com/Karaka-Management/oms-News.git
synced 2026-02-10 13:58:41 +00:00
phpstan fixes
This commit is contained in:
parent
d76ec5aa9f
commit
06a6117bb8
|
|
@ -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'))) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user