mirror of
https://github.com/Karaka-Management/oms-QA.git
synced 2026-02-09 12:38:41 +00:00
Type and cs fixes
This commit is contained in:
parent
2e09552d20
commit
aa536763a7
|
|
@ -14,7 +14,10 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\QA\Controller;
|
||||
|
||||
use Modules\QA\Models\NullQACategory;
|
||||
use Modules\QA\Models\NullQAQuestion;
|
||||
use Modules\QA\Models\QAAnswer;
|
||||
use Modules\QA\Models\QAAnswerMapper;
|
||||
use Modules\QA\Models\QAAnswerStatus;
|
||||
use Modules\QA\Models\QACategory;
|
||||
use Modules\QA\Models\QACategoryMapper;
|
||||
|
|
@ -86,7 +89,7 @@ final class ApiController extends Controller
|
|||
$question->setName((string) $request->getData('title'));
|
||||
$question->setQuestion((string) $request->getData('plain'));
|
||||
$question->setLanguage((string) $request->getData('language'));
|
||||
$question->setCategory((int) $request->getData('category'));
|
||||
$question->setCategory(new NullQACategory((int) $request->getData('category')));
|
||||
$question->setStatus((int) $request->getData('status'));
|
||||
$question->setBadges((array) $request->getData('badges'));
|
||||
|
||||
|
|
@ -161,9 +164,8 @@ final class ApiController extends Controller
|
|||
$mardkownParser = new Markdown();
|
||||
|
||||
$answer = new QAAnswer();
|
||||
$answer->setName((string) $request->getData('title'));
|
||||
$answer->setAnswer((string) $request->getData('plain'));
|
||||
$answer->setQuestion((int) $request->getData('question'));
|
||||
$answer->setQuestion(new NullQAQuestion((int) $request->getData('question')));
|
||||
$answer->setStatus((int) $request->getData('status'));
|
||||
|
||||
return $answer;
|
||||
|
|
@ -236,7 +238,7 @@ final class ApiController extends Controller
|
|||
|
||||
$category = new QACategory();
|
||||
$category->setName((string) $request->getData('title'));
|
||||
$category->setParent((int) $request->getData('parent'));
|
||||
$category->setParent($request->getData('parent') === null ? null : new NullQACategory((int) $request->getData('parent')));
|
||||
|
||||
return $category;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class QAAnswer implements \JsonSerializable
|
|||
* Answer.
|
||||
*
|
||||
* @var string
|
||||
* @var 1.0.0
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private $answer = '';
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ class QAAnswer implements \JsonSerializable
|
|||
* Answer raw.
|
||||
*
|
||||
* @var string
|
||||
* @var 1.0.0
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private $answerRaw = '';
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ class QAAnswer implements \JsonSerializable
|
|||
* Is accepted answer.
|
||||
*
|
||||
* @var bool
|
||||
* @var 1.0.0
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private bool $isAccepted = false;
|
||||
|
||||
|
|
@ -73,7 +73,7 @@ class QAAnswer implements \JsonSerializable
|
|||
* Created by.
|
||||
*
|
||||
* @var Account
|
||||
* @var 1.0.0
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private Account $createdBy;
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ class QAAnswer implements \JsonSerializable
|
|||
* Created at.
|
||||
*
|
||||
* @var \DateTime
|
||||
* @var 1.0.0
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private \DateTime $createdAt;
|
||||
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ class QAQuestion implements \JsonSerializable
|
|||
/**
|
||||
* Get the category
|
||||
*
|
||||
* @return mixed
|
||||
* @return QACategory
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ final class QAQuestionMapper extends DataMapperAbstract
|
|||
/**
|
||||
* Has many relation.
|
||||
*
|
||||
* @var array<string, array{mapper:string, table:string, self?:?string, external?:?string}>
|
||||
* @var array<string, array{mapper:string, table:string, self?:?string, external?:?string, column?:string}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static array $hasMany = [
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user