public function aggregate($healths)
    {
        $statusCandidates = [];
        foreach ($healths as $key => $health) {
            $statusCandidates[] = $health->getStatus();
        }
        $status = $this->aggregateStatus($statusCandidates);
        $details = $this->aggregateDetails($healths);
        $builder = new HealthBuilder($status, $details);

        return $builder->build();
    }
public function aggregate($healths)
    {
        $statusCandidates = [];
        foreach ($healths as $key => $health) {
            $statusCandidates[] = $health->getStatus();
        }
        $status = $this->aggregateStatus($statusCandidates);
        $details = $this->aggregateDetails($healths);
        $builder = new HealthBuilder($status, $details);

        return $builder->build();
    }
public function aggregate ( $ healths ) { $ statusCandidates = [ ] ; foreach ( $ healths as $ key => $ health ) { $ statusCandidates [ ] = $ health -> getStatus ( ) ; } $ status = $ this -> aggregateStatus ( $ statusCandidates ) ; $ details = $ this -> aggregateDetails ( $ healths ) ; $ builder = new HealthBuilder ( $ status , $ details ) ; return $ builder -> build ( ) ; }
Aggregate several given Health instances into one.

@param Health[] $healths

@return Health
Aggregate several given Health instances into one .