mirror of
https://github.com/Karaka-Management/oms-Tasks.git
synced 2026-02-14 21:58:40 +00:00
Fix minor bugs for full inspections
This commit is contained in:
parent
92428821fc
commit
cec9895c93
|
|
@ -16,8 +16,8 @@ namespace Modules\Tasks\Admin;
|
||||||
|
|
||||||
use phpOMS\DataStorage\Database\DatabasePool;
|
use phpOMS\DataStorage\Database\DatabasePool;
|
||||||
use phpOMS\DataStorage\Database\Schema\Builder;
|
use phpOMS\DataStorage\Database\Schema\Builder;
|
||||||
use phpOMS\Module\InfoManager;
|
|
||||||
use phpOMS\Module\UninstallAbstract;
|
use phpOMS\Module\UninstallAbstract;
|
||||||
|
use phpOMS\Module\InfoManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Navigation class.
|
* Navigation class.
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,10 @@ declare(strict_types=1);
|
||||||
namespace Modules\Tasks\Admin;
|
namespace Modules\Tasks\Admin;
|
||||||
|
|
||||||
use phpOMS\DataStorage\Database\DatabasePool;
|
use phpOMS\DataStorage\Database\DatabasePool;
|
||||||
use phpOMS\Module\InfoManager;
|
|
||||||
use phpOMS\Module\UpdateAbstract;
|
use phpOMS\Module\UpdateAbstract;
|
||||||
use phpOMS\System\File\Directory;
|
use phpOMS\System\File\Directory;
|
||||||
|
use phpOMS\Module\InfoManager;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Navigation class.
|
* Navigation class.
|
||||||
|
|
|
||||||
|
|
@ -351,7 +351,7 @@ class Task implements \JsonSerializable
|
||||||
public function setStatus(int $status)
|
public function setStatus(int $status)
|
||||||
{
|
{
|
||||||
if(!TaskStatus::isValidValue($status)) {
|
if(!TaskStatus::isValidValue($status)) {
|
||||||
throw new InvalidEnumValue($status);
|
throw new InvalidEnumValue((string) $status);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->status = $status;
|
$this->status = $status;
|
||||||
|
|
@ -377,7 +377,7 @@ class Task implements \JsonSerializable
|
||||||
public function setPriority(int $priority)
|
public function setPriority(int $priority)
|
||||||
{
|
{
|
||||||
if(!TaskStatus::isValidValue($priority)) {
|
if(!TaskStatus::isValidValue($priority)) {
|
||||||
throw new InvalidEnumValue($priority);
|
throw new InvalidEnumValue((string) $priority);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->priority = $priority;
|
$this->priority = $priority;
|
||||||
|
|
@ -486,17 +486,17 @@ class Task implements \JsonSerializable
|
||||||
return $this->schedule;
|
return $this->schedule;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function toArray() : array
|
public function toArray() : array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'createdBy' => $this->createdBy,
|
'createdBy' => $this->createdBy,
|
||||||
'createdAt' => $this->createdAt,
|
'createdAt' => $this->createdAt->format('Y-m-d H:i:s'),
|
||||||
'title' => $this->title,
|
'title' => $this->title,
|
||||||
'description' => $this->description,
|
'description' => $this->description,
|
||||||
'status' => $this->status,
|
'status' => $this->status,
|
||||||
'type' => $this->type,
|
'type' => $this->type,
|
||||||
'type' => $this->type,
|
'priority' => $this->priority,
|
||||||
'due' => $this->due->format('Y-m-d H:i:s'),
|
'due' => $this->due->format('Y-m-d H:i:s'),
|
||||||
'done' => (!isset($this->done) ? null : $this->done->format('Y-m-d H:i:s')),
|
'done' => (!isset($this->done) ? null : $this->done->format('Y-m-d H:i:s')),
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -267,7 +267,7 @@ class TaskElement implements \JsonSerializable
|
||||||
public function setStatus(int $status)
|
public function setStatus(int $status)
|
||||||
{
|
{
|
||||||
if(!TaskStatus::isValidValue($status)) {
|
if(!TaskStatus::isValidValue($status)) {
|
||||||
throw new InvalidEnumValue($status);
|
throw new InvalidEnumValue((string) $status);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->status = $status;
|
$this->status = $status;
|
||||||
|
|
|
||||||
|
|
@ -31,5 +31,5 @@ class TaskTemplate extends Task
|
||||||
* @var TaskType
|
* @var TaskType
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $type = TaskType::TEMPLATE;
|
protected $type = TaskType::TEMPLATE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user