createdAt = new \DateTimeImmutable('now'); $this->unit = new NullUnit(); $this->source = new NullCollection(); $this->createdBy = new NullAccount(); } /** * Get newest report for template. * * @return Report * * @since 1.0.0 */ public function getNewestReport() : Report { if (!empty($this->reports)) { return \end($this->reports); } return new NullReport(); } /** * Get expected files from report * * @return array * * @since 1.0.0 */ public function getExpected() : array { return $this->expected; } /** * Add expected file from report * * @param string $expected Expected file * * @return void * * @since 1.0.0 */ public function addExpected(string $expected) : void { $this->expected[] = $expected; } /** * Set expected file from report * * @param array $expected Expected file * * @return void * * @since 1.0.0 */ public function setExpected(array $expected) : void { $this->expected = $expected; } /** * Set data type basis * * @param int $datatype Template datatype source * * @return void * * @since 1.0.0 */ public function setDatatype(int $datatype) : void { $this->datatype = $datatype; } /** * Get data type basis * * @return int * * @since 1.0.0 */ public function getDatatype() : int { return $this->datatype; } /** * {@inheritdoc} */ public function toArray() : array { return [ 'id' => $this->id, 'createdBy' => $this->createdBy, 'createdAt' => $this->createdAt, 'name' => $this->name, 'description' => $this->description, 'descriptionRaw' => $this->descriptionRaw, 'status' => $this->status, 'datatype' => $this->datatype, 'standalone' => $this->isStandalone, ]; } /** * {@inheritdoc} */ public function jsonSerialize() : mixed { return $this->toArray(); } }