numberOfTasksCompleted = $numberOfTasksCompleted; $this->numberOfTasksFailed = $numberOfTasksFailed; $this->numberOfTasksInProgress = $numberOfTasksInProgress; } /** * @param array $rawData * @return TasksLogsStats */ public static function buildFromArray(array $rawData) { return new self($rawData[static::COMPLETED_TASKS], $rawData[static::FAILED_TASKS], $rawData[static::IN_PROGRESS_TASKS]); } /** * @return int */ public function getNumberOfTasksCompleted() { return $this->numberOfTasksCompleted; } /** * @return int */ public function getNumberOfTasksFailed() { return $this->numberOfTasksFailed; } /** * @return int */ public function getNumberOfTasksInProgress() { return $this->numberOfTasksInProgress; } /** * @inheritdoc */ public function jsonSerialize() { return [ 'numberOfTasksCompleted' => $this->numberOfTasksCompleted, 'numberOfTasksFailed' => $this->numberOfTasksFailed, 'numberOfTasksInProgress' => $this->numberOfTasksInProgress, ]; } /** * @return array */ public function toArray() { return $this->jsonSerialize(); } }