Mercurial > hg > isophonics-drupal-site
diff vendor/zendframework/zend-feed/src/PubSubHubbub/AbstractCallback.php @ 12:7a779792577d
Update Drupal core to v8.4.5 (via Composer)
author | Chris Cannam |
---|---|
date | Fri, 23 Feb 2018 15:52:07 +0000 |
parents | 4c8ae668cc8c |
children | c2387f117808 |
line wrap: on
line diff
--- a/vendor/zendframework/zend-feed/src/PubSubHubbub/AbstractCallback.php Fri Feb 23 15:51:18 2018 +0000 +++ b/vendor/zendframework/zend-feed/src/PubSubHubbub/AbstractCallback.php Fri Feb 23 15:52:07 2018 +0000 @@ -67,7 +67,7 @@ $options = ArrayUtils::iteratorToArray($options); } - if (!is_array($options)) { + if (! is_array($options)) { throw new Exception\InvalidArgumentException('Array or Traversable object' . 'expected, got ' . gettype($options)); } @@ -137,7 +137,7 @@ */ public function setHttpResponse($httpResponse) { - if (!$httpResponse instanceof HttpResponse && !$httpResponse instanceof PhpResponse) { + if (! $httpResponse instanceof HttpResponse && ! $httpResponse instanceof PhpResponse) { throw new Exception\InvalidArgumentException('HTTP Response object must' . ' implement one of Zend\Feed\Pubsubhubbub\HttpResponse or' . ' Zend\Http\PhpEnvironment\Response'); @@ -196,8 +196,10 @@ * Attempt to detect the callback URL (specifically the path forward) * @return string */ + // @codingStandardsIgnoreStart protected function _detectCallbackUrl() { + // @codingStandardsIgnoreEnd $callbackUrl = ''; if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) { $callbackUrl = $_SERVER['HTTP_X_ORIGINAL_URL']; @@ -214,8 +216,8 @@ $callbackUrl = substr($callbackUrl, strlen($schemeAndHttpHost)); } } elseif (isset($_SERVER['ORIG_PATH_INFO'])) { - $callbackUrl= $_SERVER['ORIG_PATH_INFO']; - if (!empty($_SERVER['QUERY_STRING'])) { + $callbackUrl = $_SERVER['ORIG_PATH_INFO']; + if (! empty($_SERVER['QUERY_STRING'])) { $callbackUrl .= '?' . $_SERVER['QUERY_STRING']; } } @@ -227,9 +229,11 @@ * * @return string */ + // @codingStandardsIgnoreStart protected function _getHttpHost() { - if (!empty($_SERVER['HTTP_HOST'])) { + // @codingStandardsIgnoreEnd + if (! empty($_SERVER['HTTP_HOST'])) { return $_SERVER['HTTP_HOST']; } $scheme = 'http'; @@ -253,19 +257,21 @@ * @param string $header * @return bool|string */ + // @codingStandardsIgnoreStart protected function _getHeader($header) { + // @codingStandardsIgnoreEnd $temp = strtoupper(str_replace('-', '_', $header)); - if (!empty($_SERVER[$temp])) { + if (! empty($_SERVER[$temp])) { return $_SERVER[$temp]; } $temp = 'HTTP_' . strtoupper(str_replace('-', '_', $header)); - if (!empty($_SERVER[$temp])) { + if (! empty($_SERVER[$temp])) { return $_SERVER[$temp]; } if (function_exists('apache_request_headers')) { $headers = apache_request_headers(); - if (!empty($headers[$header])) { + if (! empty($headers[$header])) { return $headers[$header]; } } @@ -277,8 +283,10 @@ * * @return string|false Raw body, or false if not present */ + // @codingStandardsIgnoreStart protected function _getRawBody() { + // @codingStandardsIgnoreEnd $body = file_get_contents('php://input'); if (strlen(trim($body)) == 0 && isset($GLOBALS['HTTP_RAW_POST_DATA'])) { $body = $GLOBALS['HTTP_RAW_POST_DATA'];