CBitrixCloudMonitoring::getWorstUptime: Bitrix method

      
<?php 
//  CBitrixCloudMonitoring :: getWorstUptime()
//  /dist/bitrix/modules/bitrixcloud/classes/general/monitoring.php:263

    
public function getWorstUptime($testId ""$domainName "")
    {
        
$result "";
        
$maxDiff 0;

        if (
$this->result)
        {
            if (
$domainName === "")
            {
                foreach (
$this->result as $domainName => $domainResult)
                {
                    foreach (
$domainResult as $testId => $testResult)
                    {
                        if (
                            (
$testId === "" || $testId === $testResult->getName())
                            && 
$testResult->getStatus() === CBitrixCloudMonitoringResult::RED_LAMP
                        
)
                        {
                            
$uptime explode("/"$testResult->getUptime());
                            
$diff $uptime[1] - $uptime[0];
                            if (
$diff $maxDiff)
                            {
                                
$maxDiff $diff;
                                
$result $testResult->getUptime();
                            }
                        }
                    }
                }
            }
            elseif (
is_array($this->result[$domainName]))
            {
                foreach (
$this->result[$domainName] as $testId => $testResult)
                {
                    if (
                        (
$testId === "" || $testId === $testResult->getName())
                        && 
$testResult->getStatus() === CBitrixCloudMonitoringResult::RED_LAMP
                    
)
                    {
                        
$uptime explode("/"$testResult->getUptime());
                        
$diff $uptime[1] - $uptime[0];
                        if (
$diff $maxDiff)
                        {
                            
$maxDiff $diff;
                            
$result $testResult->getUptime();
                        }
                    }
                }
            }
        }

        return 
$result;
    }