mirror of
https://github.com/Karaka-Management/oms-QA.git
synced 2026-02-15 15:28:42 +00:00
Automated formatting changes
This commit is contained in:
parent
c9a2faa1de
commit
7dbf3fb489
|
|
@ -12,8 +12,6 @@
|
||||||
*/
|
*/
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
use phpOMS\Uri\UriFactory;
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,6 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Modules\QA\Admin\Install;
|
namespace Modules\QA\Admin\Install;
|
||||||
|
|
||||||
use Model\Setting;
|
|
||||||
use Model\SettingMapper;
|
|
||||||
use phpOMS\Application\ApplicationAbstract;
|
use phpOMS\Application\ApplicationAbstract;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ use phpOMS\Module\ModuleInfo;
|
||||||
*/
|
*/
|
||||||
final class Installer extends InstallerAbstract
|
final class Installer extends InstallerAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public static function install(DatabasePool $dbPool, ModuleInfo $info, SettingsInterface $cfgHandler) : void
|
public static function install(DatabasePool $dbPool, ModuleInfo $info, SettingsInterface $cfgHandler) : void
|
||||||
|
|
|
||||||
|
|
@ -352,7 +352,7 @@ final class ApiController extends Controller
|
||||||
*/
|
*/
|
||||||
public function createQAAppFromRequest(RequestAbstract $request) : QAApp
|
public function createQAAppFromRequest(RequestAbstract $request) : QAApp
|
||||||
{
|
{
|
||||||
$app = new QAApp();
|
$app = new QAApp();
|
||||||
$app->name = $request->getData('name') ?? '';
|
$app->name = $request->getData('name') ?? '';
|
||||||
|
|
||||||
return $app;
|
return $app;
|
||||||
|
|
|
||||||
|
|
@ -14,14 +14,14 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Modules\QA\Controller;
|
namespace Modules\QA\Controller;
|
||||||
|
|
||||||
use Modules\QA\Models\QAQuestionMapper;
|
|
||||||
use Modules\QA\Models\QAAppMapper;
|
use Modules\QA\Models\QAAppMapper;
|
||||||
|
use Modules\QA\Models\QAHelperMapper;
|
||||||
|
use Modules\QA\Models\QAQuestionMapper;
|
||||||
use phpOMS\Asset\AssetType;
|
use phpOMS\Asset\AssetType;
|
||||||
use phpOMS\Contract\RenderableInterface;
|
use phpOMS\Contract\RenderableInterface;
|
||||||
use phpOMS\Message\RequestAbstract;
|
use phpOMS\Message\RequestAbstract;
|
||||||
use phpOMS\Message\ResponseAbstract;
|
use phpOMS\Message\ResponseAbstract;
|
||||||
use phpOMS\Views\View;
|
use phpOMS\Views\View;
|
||||||
use Modules\QA\Models\QAHelperMapper;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* QA backend controller class.
|
* QA backend controller class.
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ final class QAAnswerVoteMapper extends DataMapperAbstract
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public static function findVote(int $answer, int $account) : bool|QAAnswerVote
|
public static function findVote(int $answer, int $account) : bool | QAAnswerVote
|
||||||
{
|
{
|
||||||
$depth = 3;
|
$depth = 3;
|
||||||
$query = self::getQuery();
|
$query = self::getQuery();
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ final class QAHelperMapper extends DataMapperAbstract
|
||||||
{
|
{
|
||||||
$scores = [];
|
$scores = [];
|
||||||
|
|
||||||
$query = new Builder(self::$db);
|
$query = new Builder(self::$db);
|
||||||
$questionScore = $query->select('qa_question_created_by')
|
$questionScore = $query->select('qa_question_created_by')
|
||||||
->selectAs('SUM(qa_question_vote_score)', 'score')
|
->selectAs('SUM(qa_question_vote_score)', 'score')
|
||||||
->from(QAQuestionVoteMapper::getTable())
|
->from(QAQuestionVoteMapper::getTable())
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ final class QAQuestionMapper extends DataMapperAbstract
|
||||||
'qa_question_status' => ['name' => 'qa_question_status', 'type' => 'int', 'internal' => 'status'],
|
'qa_question_status' => ['name' => 'qa_question_status', 'type' => 'int', 'internal' => 'status'],
|
||||||
'qa_question_created_by' => ['name' => 'qa_question_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
|
'qa_question_created_by' => ['name' => 'qa_question_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
|
||||||
'qa_question_created_at' => ['name' => 'qa_question_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
'qa_question_created_at' => ['name' => 'qa_question_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
||||||
'qa_question_app' => ['name' => 'qa_question_app', 'type' => 'int', 'internal' => 'app'],
|
'qa_question_app' => ['name' => 'qa_question_app', 'type' => 'int', 'internal' => 'app'],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ final class QAQuestionVoteMapper extends DataMapperAbstract
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public static function findVote(int $question, int $account) : bool|QAQuestionVote
|
public static function findVote(int $question, int $account) : bool | QAQuestionVote
|
||||||
{
|
{
|
||||||
$depth = 3;
|
$depth = 3;
|
||||||
$query = self::getQuery();
|
$query = self::getQuery();
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ echo $this->getData('nav')->render();
|
||||||
<a class="account-info" href="<?= UriFactory::build('{/prefix}profile/single?{?}&id=' . $question->createdBy->getId()); ?>">
|
<a class="account-info" href="<?= UriFactory::build('{/prefix}profile/single?{?}&id=' . $question->createdBy->getId()); ?>">
|
||||||
<span class="name">
|
<span class="name">
|
||||||
<div class="content"><?= $this->printHtml($question->createdBy->account->name2); ?>, <?= $this->printHtml($question->createdBy->account->name1); ?></div>
|
<div class="content"><?= $this->printHtml($question->createdBy->account->name2); ?>, <?= $this->printHtml($question->createdBy->account->name1); ?></div>
|
||||||
<div class="name-score">Score: <?= $scores[$question->createdBy->account->getId()] ?? 0 ?></div>
|
<div class="name-score">Score: <?= $scores[$question->createdBy->account->getId()] ?? 0; ?></div>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<?php if ($question->createdBy->image !== null && !($question->createdBy->image instanceof NullMedia)) : ?>
|
<?php if ($question->createdBy->image !== null && !($question->createdBy->image instanceof NullMedia)) : ?>
|
||||||
|
|
@ -100,7 +100,7 @@ echo $this->getData('nav')->render();
|
||||||
<a class="account-info" href="<?= UriFactory::build('{/prefix}profile/single?{?}&id=' . $answer->createdBy->getId()); ?>">
|
<a class="account-info" href="<?= UriFactory::build('{/prefix}profile/single?{?}&id=' . $answer->createdBy->getId()); ?>">
|
||||||
<span class="name">
|
<span class="name">
|
||||||
<div class="content"><?= $this->printHtml($answer->createdBy->account->name2); ?> <?= $this->printHtml($answer->createdBy->account->name1); ?></div>
|
<div class="content"><?= $this->printHtml($answer->createdBy->account->name2); ?> <?= $this->printHtml($answer->createdBy->account->name1); ?></div>
|
||||||
<div class="name-score">Score: <?= $scores[$answer->createdBy->account->getId()] ?? 0 ?></div>
|
<div class="name-score">Score: <?= $scores[$answer->createdBy->account->getId()] ?? 0; ?></div>
|
||||||
</span>
|
</span>
|
||||||
<?php if ($answer->createdBy->image !== null && !($answer->createdBy->image instanceof NullMedia)) : ?>
|
<?php if ($answer->createdBy->image !== null && !($answer->createdBy->image instanceof NullMedia)) : ?>
|
||||||
<img width="40px" alt="<?= $this->getHtml('AccountImage', '0', '0'); ?>" loading="lazy" src="<?= UriFactory::build('{/prefix}' . $answer->createdBy->image->getPath()); ?>">
|
<img width="40px" alt="<?= $this->getHtml('AccountImage', '0', '0'); ?>" loading="lazy" src="<?= UriFactory::build('{/prefix}' . $answer->createdBy->image->getPath()); ?>">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user