- WIP on TaskReport
This commit is contained in:
		
							parent
							
								
									6227321045
								
							
						
					
					
						commit
						7b5a1bcf97
					
				@ -45,6 +45,7 @@ namespace Negundo\Client {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
namespace {
 | 
					namespace {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    use Negundo\Client\Task\StatusEnum;
 | 
				
			||||||
    use Negundo\Client\Task\TaskReport;
 | 
					    use Negundo\Client\Task\TaskReport;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (! function_exists('ntask') ) {
 | 
					    if (! function_exists('ntask') ) {
 | 
				
			||||||
@ -58,8 +59,11 @@ namespace {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        function nreport(TaskReport $report) {
 | 
					        function nreport(TaskReport $report)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if ($report->status !== StatusEnum::NothingToDo || $report->getEvents()) {
 | 
				
			||||||
                ntask($report->getMessage(), $report->getTitle(), $report->getData(), $report->getStatus(), $report->getEvents());
 | 
					                ntask($report->getMessage(), $report->getTitle(), $report->getData(), $report->getStatus(), $report->getEvents());
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -20,7 +20,7 @@ class TaskReport
 | 
				
			|||||||
        return $this;
 | 
					        return $this;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function addEvent(string $key, ? StatusEnum $status = null, array $data) : static
 | 
					    public function addEvent(string $key, ? StatusEnum $status = null, array $data = []) : static
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $this->events[] = [
 | 
					        $this->events[] = [
 | 
				
			||||||
            'key' => $key,
 | 
					            'key' => $key,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user