EricMakesStuff\ServerMonitor\Monitors\HttpPingMonitor::getResponseCode PHP Method

getResponseCode() public method

public getResponseCode ( )
    public function getResponseCode()
    {
        return $this->responseCode;
    }

Usage Example

 /**
  * @param HttpPingMonitor $httpPingMonitor
  */
 public function httpPingDown(HttpPingMonitor $httpPingMonitor)
 {
     $additionalInfo = '';
     if ($httpPingMonitor->getCheckPhrase() && !$httpPingMonitor->getResponseContainsPhrase()) {
         $additionalInfo = " Response did not contain \"{$httpPingMonitor->getCheckPhrase()}\"";
     }
     $this->sendNotification('whenHttpPingDown', "HTTP Ping Failed: {$httpPingMonitor->getUrl()}!", "HTTP Ping Failed for {$httpPingMonitor->getUrl()}! Response Code {$httpPingMonitor->getResponseCode()}.{$additionalInfo}", BaseSender::TYPE_ERROR);
 }
All Usage Examples Of EricMakesStuff\ServerMonitor\Monitors\HttpPingMonitor::getResponseCode