Fix minor bugs for full inspections

This commit is contained in:
Dennis Eichhorn 2017-10-15 18:54:27 +02:00
parent 92428821fc
commit cec9895c93
5 changed files with 10 additions and 9 deletions

View File

@ -16,8 +16,8 @@ namespace Modules\Tasks\Admin;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\DataStorage\Database\Schema\Builder;
use phpOMS\Module\InfoManager;
use phpOMS\Module\UninstallAbstract;
use phpOMS\Module\InfoManager;
/**
* Navigation class.

View File

@ -15,9 +15,10 @@ declare(strict_types=1);
namespace Modules\Tasks\Admin;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\Module\InfoManager;
use phpOMS\Module\UpdateAbstract;
use phpOMS\System\File\Directory;
use phpOMS\Module\InfoManager;
/**
* Navigation class.

View File

@ -351,7 +351,7 @@ class Task implements \JsonSerializable
public function setStatus(int $status)
{
if(!TaskStatus::isValidValue($status)) {
throw new InvalidEnumValue($status);
throw new InvalidEnumValue((string) $status);
}
$this->status = $status;
@ -377,7 +377,7 @@ class Task implements \JsonSerializable
public function setPriority(int $priority)
{
if(!TaskStatus::isValidValue($priority)) {
throw new InvalidEnumValue($priority);
throw new InvalidEnumValue((string) $priority);
}
$this->priority = $priority;
@ -486,17 +486,17 @@ class Task implements \JsonSerializable
return $this->schedule;
}
private function toArray() : array
public function toArray() : array
{
return [
'id' => $this->id,
'createdBy' => $this->createdBy,
'createdAt' => $this->createdAt,
'createdAt' => $this->createdAt->format('Y-m-d H:i:s'),
'title' => $this->title,
'description' => $this->description,
'status' => $this->status,
'type' => $this->type,
'type' => $this->type,
'priority' => $this->priority,
'due' => $this->due->format('Y-m-d H:i:s'),
'done' => (!isset($this->done) ? null : $this->done->format('Y-m-d H:i:s')),
];

View File

@ -267,7 +267,7 @@ class TaskElement implements \JsonSerializable
public function setStatus(int $status)
{
if(!TaskStatus::isValidValue($status)) {
throw new InvalidEnumValue($status);
throw new InvalidEnumValue((string) $status);
}
$this->status = $status;

View File

@ -31,5 +31,5 @@ class TaskTemplate extends Task
* @var TaskType
* @since 1.0.0
*/
private $type = TaskType::TEMPLATE;
protected $type = TaskType::TEMPLATE;
}