<?php
declare(strict_types=1);
namespace App\Services\Pipeline;
abstract class AbstractPipelineStep implements PipelineStep {
 protected function result(string $decision,int $score,string $message,array $issues=[],array $warnings=[],array $details=[],bool $critical=false):array {
  return ['code'=>$this->code(),'label'=>$this->label(),'order'=>$this->order(),'status'=>$decision==='ERROR'?'ERROR':'COMPLETED','decision'=>$decision,'score'=>max(0,min(100,$score)),'critical'=>$critical,'message'=>$message,'issues'=>array_values(array_unique($issues)),'warnings'=>array_values(array_unique($warnings)),'details'=>$details];
 }
}
