0) { if(count($lables) === 1) { $uri .= '&labels=' . urlencode($labels[0]); } else { foreach($labels as $label) { $uri .= '&labels[]=' . urlencode($label); } } } elseif(!is_null($labels) && is_string($labels)) { $uri .= '&labels=' . urlencode($labels); } // Add maintainer if(!empty($maintainer)) { $uri .= '&assignee=' . urlencode($maintainer); } return $uri; } /** * Returns the exception message as HTML string * * @param $e Exception The exception to show * @param $bridge object The bridge object * @return string Returns the exception as HTML string. Returns null if the * provided parameter are invalid */ function buildBridgeException($e, $bridge){ if(( !($e instanceof \Exception) && !($e instanceof \Error)) || !($bridge instanceof \BridgeInterface)) { return null; } $title = $bridge->getName() . ' failed with error ' . $e->getCode(); // Build a GitHub compatible message $body = 'Error message: `' . $e->getMessage() . "`\nQuery string: `" . $_SERVER['QUERY_STRING'] . '`'; $link = buildGitHubIssueQuery($title, $body, 'bug report', $bridge->getMaintainer()); $header = buildHeader($e, $bridge); $message = "{$bridge->getName()} was unable to receive or process the remote website's content!"; $section = buildSection($e, $bridge, $message, $link); return buildPage($title, $header, $section); } /** * Returns the exception message as HTML string * * @param $e Exception The exception to show * @param $bridge object The bridge object * @return string Returns the exception as HTML string. Returns null if the * provided parameter are invalid */ function buildTransformException($e, $bridge){ if(( !($e instanceof \Exception) && !($e instanceof \Error)) || !($bridge instanceof \BridgeInterface)) { return null; } $title = $bridge->getName() . ' failed with error ' . $e->getCode(); // Build a GitHub compatible message $body = 'Error message: `' . $e->getMessage() . "`\nQuery string: `" . $_SERVER['QUERY_STRING'] . '`'; $link = buildGitHubIssueQuery($title, $body, 'bug report', $bridge->getMaintainer()); $header = buildHeader($e, $bridge); $message = "RSS-Bridge was unable to transform the contents returned by {$bridge->getName()}!"; $section = buildSection($e, $bridge, $message, $link); return buildPage($title, $header, $section); } function buildHeader($e, $bridge){ return << Error {$e->getCode()} {$e->getMessage()} {$bridge->getName()} EOD; } function buildSection($e, $bridge, $message, $link){ return << {$message} Press Return to check your input parameters Press F5 to retry Open a GitHub Issue if this error persists Open GitHub Issue {$bridge->getMaintainer()} EOD; } function buildPage($title, $header, $section){ return << {$title} {$header} {$section} EOD; }
{$bridge->getName()}
{$message}
{$bridge->getMaintainer()}