mirror of
https://github.com/Karaka-Management/oms-Comments.git
synced 2026-02-10 06:28:42 +00:00
autofixes
This commit is contained in:
parent
3956d635cf
commit
d24b4848cf
|
|
@ -131,11 +131,11 @@ final class ApiController extends Controller
|
|||
*/
|
||||
private function createCommentFromRequest(RequestAbstract $request) : Comment
|
||||
{
|
||||
$comment = new Comment();
|
||||
$comment->createdBy = new NullAccount($request->header->account);
|
||||
$comment->title = (string) ($request->getData('title') ?? '');
|
||||
$comment = new Comment();
|
||||
$comment->createdBy = new NullAccount($request->header->account);
|
||||
$comment->title = (string) ($request->getData('title') ?? '');
|
||||
$comment->contentRaw = (string) ($request->getData('plain') ?? '');
|
||||
$comment->content = Markdown::parse((string) ($request->getData('plain') ?? ''));
|
||||
$comment->content = Markdown::parse((string) ($request->getData('plain') ?? ''));
|
||||
$comment->setRef($request->getData('ref') !== null ? (int) $request->getData('ref') : null);
|
||||
$comment->setList((int) ($request->getData('list') ?? 0));
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ foreach ($comments as $comment) : ?>
|
|||
<div class="col-xs-12">
|
||||
<section class="portlet">
|
||||
<article>
|
||||
<?= $comment->getContent(); ?>
|
||||
<?= $comment->content; ?>
|
||||
</article>
|
||||
</section>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -32,9 +32,9 @@ class CommentListMapperTest extends \PHPUnit\Framework\TestCase
|
|||
{
|
||||
$list = new CommentList();
|
||||
|
||||
$comment = new Comment();
|
||||
$comment = new Comment();
|
||||
$comment->createdBy = new NullAccount(1);
|
||||
$comment->title = 'Test Comment';
|
||||
$comment->title = 'Test Comment';
|
||||
|
||||
$list->addComment($comment);
|
||||
|
||||
|
|
|
|||
|
|
@ -39,11 +39,11 @@ class CommentListTest extends \PHPUnit\Framework\TestCase
|
|||
*/
|
||||
public function testGetSet() : void
|
||||
{
|
||||
$list = new CommentList();
|
||||
$comment = new Comment();
|
||||
$comment->title = 'Test Title';
|
||||
$list = new CommentList();
|
||||
$comment = new Comment();
|
||||
$comment->title = 'Test Title';
|
||||
$comment->contentRaw = 'TestRaw';
|
||||
$comment->content = 'Test Content';
|
||||
$comment->content = 'Test Content';
|
||||
|
||||
$list->addComment($comment);
|
||||
self::assertEquals('Test Title', $list->getComments()[0]->title);
|
||||
|
|
|
|||
|
|
@ -30,10 +30,10 @@ class CommentMapperTest extends \PHPUnit\Framework\TestCase
|
|||
*/
|
||||
public function testCRUD() : void
|
||||
{
|
||||
$comment = new Comment();
|
||||
$comment = new Comment();
|
||||
$comment->createdBy = new NullAccount(1);
|
||||
$comment->title = 'Test Title';
|
||||
$comment->content = 'Test Content';
|
||||
$comment->title = 'Test Title';
|
||||
$comment->content = 'Test Content';
|
||||
$comment->setRef(null);
|
||||
$comment->setList(new CommentList());
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user