Render the details of each failed request including the mismatching headers and body.

@param ResultsRenderer $renderer
@return string
967755
public function render(ResultsRenderer $renderer)
    {
        $results = array_filter($this->result->getResults(), function (ResultInterface $result) {
            return $result instanceof FailureInterface;
        });

        $output = '';
        if (count($results)) {
            $output .= $renderer->center("Some requests to your solution produced incorrect output!\n");
        }

        foreach ($results as $key => $request) {
            $output .= $renderer->lineBreak();
            $output .= "\n";
            $output .= $renderer->style(sprintf('Request %d', $key + 1), ['bold', 'underline', 'blue']);
            $output .= ' ' . $renderer->style(' FAILED ', ['bg_red', 'bold']) . "\n\n";
            $output .= "Request Details:\n\n";
            $output .= $this->requestRenderer->renderRequest($request->getRequest()) . "\n";

            $output .= $renderer->renderResult($request) . "\n";
        }

        return $output;
    }
142010
public function display(core_backup_renderer $renderer) {

        $html  = '';
        if (!empty($this->results['file_aliases_restore_failures'])) {
            $html .= $renderer->box_start('generalbox filealiasesfailures');
            $html .= $renderer->heading_with_help(get_string('filealiasesrestorefailures', 'core_backup'),
                'filealiasesrestorefailures', 'core_backup');
            $html .= $renderer->container(get_string('filealiasesrestorefailuresinfo', 'core_backup'));
            $html .= $renderer->container_start('aliaseslist');
            $html .= html_writer::start_tag('ul');
            foreach ($this->results['file_aliases_restore_failures'] as $alias) {
                $html .= html_writer::tag('li', s($alias));
            }
            $html .= html_writer::end_tag('ul');
            $html .= $renderer->container_end();
            $html .= $renderer->box_end();
        }
        $html .= $renderer->box_start();
        if (array_key_exists('file_missing_in_backup', $this->results)) {
            $html .= $renderer->notification(get_string('restorefileweremissing', 'backup'), 'notifyproblem');
        }
        $html .= $renderer->notification(get_string('restoreexecutionsuccess', 'backup'), 'notifysuccess');
        $html .= $renderer->continue_button(new moodle_url('/course/view.php', array(
            'id' => $this->get_ui()->get_controller()->get_courseid())), 'get');
        $html .= $renderer->box_end();

        return $html;
    }
665223
private function withError(ResponseInterface $response, $throwable)
    {
        $detail = 'Internal Server Error';
        $extensions = [];

        if ($this->displayErrorDetails) {
            $throwables = $this->unpackThrowables($throwable);
            $extensions['error_details'] = $this->formatStacktraceForExceptions($throwables);

            $detail = $throwable->getMessage();
        }

        $problem = new HTTPProblem(500, $detail, $extensions);
        return $this->renderProblem($response, $this->renderer, $problem);
    }
1245421
public function render($renderer)
    {
        if ($this->x1 === ReportBaseElement::CURRENT_POSITION) {
            $this->x1 = $renderer->getX();
        }
        if ($this->y1 === ReportBaseElement::CURRENT_POSITION) {
            $this->y1 = $renderer->getY();
        }
        if ($this->x2 === ReportBaseElement::CURRENT_POSITION) {
            $this->x2 = $renderer->getRemainingWidth();
        }
        if ($this->y2 === ReportBaseElement::CURRENT_POSITION) {
            $this->y2 = $renderer->getY();
        }
        // Vertical line
        if ($this->x1 == $this->x2) {
            echo '<div style="position:absolute;overflow:hidden;border-', $renderer->alignRTL, ':solid black 1pt;', $renderer->alignRTL, ':', $this->x1, 'pt;top:', $this->y1 + 1, 'pt;width:1pt;height:', $this->y2 - $this->y1, "pt;\"> </div>\n";
        }
        // Horizontal line
        if ($this->y1 == $this->y2) {
            echo '<div style="position:absolute;overflow:hidden;border-top:solid black 1pt;', $renderer->alignRTL, ':', $this->x1, 'pt;top:', $this->y1 + 1, 'pt;width:', $this->x2 - $this->x1, "pt;height:1pt;\"> </div>\n";
        }
        // Keep max Y updated
        // One or the other will be higher... lasy mans way...
        $renderer->addMaxY($this->y1);
        $renderer->addMaxY($this->y2);
    }
877150
public function getHeight($renderer): float
    {
        $ct = substr_count($this->text, "\n");
        if ($ct > 0) {
            $ct += 1;
        }
        $style = $renderer->getStyle($this->styleName);

        return ($style['size'] * $ct) * $renderer->cellHeightRatio;
    }
631314
public function render( $return = false ) {

		// Get the rendered output.
		$output = $this->get_renderer()->render( $this, true );

		if ( $return ) {
			return $output;
		}

		echo wp_kses( $output, wp_kses_allowed_html( 'post' ) );
	}
983407
public function render(Render $renderer)
	{
		$radios = [];

		foreach ($this->getContents() as $radio)
		{
			$radios[] = $renderer->render($radio);
		}

		return implode('', $radios);
	}
538144
public function render(ResultsRenderer $renderer)
    {
        return sprintf(
            "  %s\n%s\n\n  %s\n%s\n",
            $renderer->style('YOUR OUTPUT:', ['bold', 'yellow']),
            $this->indent($renderer->style(sprintf('"%s"', $this->result->getActualValue()), 'red')),
            $renderer->style('EXPECTED OUTPUT:', ['bold', 'yellow']),
            $this->indent($renderer->style(sprintf('"%s"', $this->result->getExpectedValue()), 'green'))
        );
    }
853413
public function render($renderer)
    {
        static $lastpicbottom, $lastpicpage, $lastpicleft, $lastpicright;

        // Check for a pagebreak first
        if ($renderer->checkPageBreakPDF($this->height + 5)) {
            $this->y = $renderer->GetY();
        }

        $curx = $renderer->GetX();

        // Get the current positions
        if ($this->x === ReportBaseElement::CURRENT_POSITION) {
            $this->x = $renderer->GetX();
        } else {
            // For static position add margin
            $this->x = $renderer->addMarginX($this->x);
            $renderer->SetX($curx);
        }
        if ($this->y === ReportBaseElement::CURRENT_POSITION) {
            //-- first check for a collision with the last picture
            if (isset($lastpicbottom)) {
                if (($renderer->PageNo() == $lastpicpage) && ($lastpicbottom >= $renderer->GetY()) && ($this->x >= $lastpicleft) && ($this->x <= $lastpicright)
                ) {
                    $renderer->SetY($lastpicbottom + 5);
                }
            }
            $this->y = $renderer->GetY();
        } else {
            $renderer->SetY($this->y);
        }
        if ($renderer->getRTL()) {
            $renderer->Image(
                $this->file,
                $renderer->getPageWidth() - $this->x,
                $this->y,
                $this->width,
                $this->height,
                '',
                '',
                $this->line,
                false,
                72,
                $this->align
            );
        } else {
            $renderer->Image(
                $this->file,
                $this->x,
                $this->y,
                $this->width,
                $this->height,
                '',
                '',
                $this->line,
                false,
                72,
                $this->align
            );
        }
        $lastpicpage           = $renderer->PageNo();
        $renderer->lastpicpage = $renderer->getPage();
        $lastpicleft           = $this->x;
        $lastpicright          = $this->x + $this->width;
        $lastpicbottom         = $this->y + $this->height;
        // Setup for the next line
        if ($this->line === 'N') {
            $renderer->SetY($lastpicbottom);
        }
    }
1283483
public static function setRenderer($renderer) {
        if(ClassInfo::classImplements($renderer, 'IMarkdownRenderer')) {
            self::$renderer=$renderer;
        }else {
            user_error('The renderer '.$renderer.' does not implement IMarkdownRenderer', E_USER_ERROR);
        }
    }
17630
public function render(Render $renderer)
	{
		$legend = '';

		//Make sure the legend is added if needed
		if ( !is_null($this->getLegend()) )
		{
			$legend = Html::tag('legend', [], $this->getLegend());
		}

		//Makes sure the legend is added if one exists
		$elements = $legend;

		//Render all the elements
		foreach ( $this->getContents() as $element )
		{
			$elements .= "\n" . $renderer->render($element);
		}

		return Html::tag('fieldset', $this->getAttributes(), $elements);
	}
1176251
protected function getErrorText(Result $result)
    {
        /** @var $view StandaloneView */
        $view = Core::instantiate(StandaloneView::class);
        $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:' . ExtensionService::get()->getExtensionKey() . '/Resources/Private/Templates/Error/ConfigurationErrorBlock.html'));
        $layoutRootPath = StringService::get()->getExtensionRelativePath('Resources/Private/Layouts');
        $view->setLayoutRootPaths([$layoutRootPath]);
        $view->assign('result', $result);

        $templatePath = GeneralUtility::getFileAbsFileName('EXT:' . ExtensionService::get()->getExtensionKey() . '/Resources/Public/StyleSheets/Form.ErrorBlock.css');
        $this->pageRenderer->addCssFile(StringService::get()->getResourceRelativePath($templatePath));

        return $view->render();
    }
568587
public function render($renderer)
    {
        $renderer->setCurrentStyle('footnotenum');
        echo '<a href="#footnote', $this->num, '"><sup>';
        $renderer->write($renderer->entityRTL . $this->num);
        echo "</sup></a>\n";
    }
156100
public function render($raw = false)
	{
		// no links if we only have one page
		if ($this->config['total_pages'] == 1)
		{
			return $raw ? array() : '';
		}

		$this->raw_results = array();

		$html = str_replace(
			'{pagination}',
			$this->first().$this->previous().$this->pages_render().$this->next().$this->last(),
			$this->template['wrapper']
		);

		return $raw ? $this->raw_results : $html;
	}
299163
public function render($renderer)
    {
        if (strpos($this->text, '{{:ptp:}}') !== false) {
            return;
        }
        $temptext = str_replace('#PAGENUM#', (string) $renderer->pageNo(), $this->text);
        // underline «title» part of Source item
        $temptext = str_replace([
            '«',
            '»',
        ], [
            '<u>',
            '</u>',
        ], $temptext);

        // Set up the text style
        if ($renderer->getCurrentStyle() !== $this->styleName) {
            $renderer->setCurrentStyle($this->styleName);
        }

        // If (Future-feature-enable/disable cell padding)
        $cP = $renderer->cPadding;

        // Adjust the positions
        if ($this->left === ReportBaseElement::CURRENT_POSITION) {
            $this->left = $renderer->getX();
        } else {
            $renderer->setX($this->left);
        }

        if ($this->top === ReportBaseElement::CURRENT_POSITION) {
            $this->top = $renderer->getY();
        } else {
            $renderer->setY($this->top);
        }

        // Start collecting the HTML code
        echo '<div class="', $this->styleName, '" style="position:absolute;top:', $this->top, 'pt;';
        // Use Cell around padding to support RTL also
        echo 'padding:', $cP, 'pt;';
        // LTR (left) or RTL (right)
        echo $renderer->alignRTL, ':', $this->left, 'pt;';

        // Background color
        if (!empty($this->bgcolor)) {
            echo 'background-color:', $this->bgcolor, ';';
        }

        // Borders
        $bpixX = 0;
        $bpixY = 0;
        if (!empty($this->border)) {
            // Border all around
            if ($this->border == 1) {
                echo ' border:solid ';
                if (!empty($this->bocolor)) {
                    echo $this->bocolor;
                } else {
                    echo 'black';
                }
                echo ' 1pt;';
                $bpixX = 1;
                $bpixY = 1;
            } else {
                if (stripos($this->border, 'T') !== false) {
                    echo ' border-top:solid ';
                    if (!empty($this->bocolor)) {
                        echo $this->bocolor;
                    } else {
                        echo 'black';
                    }
                    echo ' 1pt;';
                    $bpixY = 1;
                }
                if (stripos($this->border, 'B') !== false) {
                    echo ' border-bottom:solid ';
                    if (!empty($this->bocolor)) {
                        echo $this->bocolor;
                    } else {
                        echo 'black';
                    }
                    echo ' 1pt;';
                    $bpixY = 1;
                }
                if (stripos($this->border, 'R') !== false) {
                    echo ' border-right:solid ';
                    if (!empty($this->bocolor)) {
                        echo $this->bocolor;
                    } else {
                        echo 'black';
                    }
                    echo ' 1pt;';
                    $bpixX = 1;
                }
                if (stripos($this->border, 'L') !== false) {
                    echo ' border-left:solid ';
                    if (!empty($this->bocolor)) {
                        echo $this->bocolor;
                    } else {
                        echo 'black';
                    }
                    echo ' 1pt;';
                    $bpixX = 1;
                }
            }
        }
        // Check the width if set to page wide OR set by xml to larger then page wide
        if ($this->width == 0 || $this->width > $renderer->getRemainingWidth()) {
            $this->width = $renderer->getRemainingWidth();
        }
        // We have to calculate a different width for the padding, counting on both side
        $cW = $this->width - ($cP * 2);

        // If there is any text
        if (!empty($temptext)) {
            // Wrap the text
            $temptext = $renderer->textWrap($temptext, $cW);
            $tmph     = $renderer->getTextCellHeight($temptext);
            // Add some cell padding
            $this->height += $cP;
            if ($tmph > $this->height) {
                $this->height = $tmph;
            }
        }
        // Check the last cell height and adjust the current cell height if needed
        if ($renderer->lastCellHeight > $this->height) {
            $this->height = $renderer->lastCellHeight;
        }
        echo ' width:', $cW - $bpixX, 'pt;height:', $this->height - $bpixY, 'pt;';

        // Text alignment
        switch ($this->align) {
            case 'C':
                echo ' text-align:center;';
                break;
            case 'L':
                echo ' text-align:left;';
                break;
            case 'R':
                echo ' text-align:right;';
                break;
        }

        // Print the collected HTML code
        echo '">';

        // Print URL
        if (!empty($this->url)) {
            echo '<a href="', $this->url, '">';
        }
        // Print any text if exists
        if (!empty($temptext)) {
            $renderer->write($temptext, $this->tcolor, false);
        }
        if (!empty($this->url)) {
            echo '</a>';
        }
        // Finish the cell printing and start to clean up
        echo "</div>\n";

        // Where to place the next position
        if ($this->newline == 0) {
            // -> Next to this cell in the same line
            $renderer->setXy($this->left + $this->width, $this->top);
            $renderer->lastCellHeight = $this->height;
        } elseif ($this->newline == 1) {
            // -> On a new line at the margin - Default
            $renderer->setXy(0, $renderer->getY() + $this->height + ($cP * 2));
            // Reset the last cell height for the next line
            $renderer->lastCellHeight = 0;
        } elseif ($this->newline == 2) {
            // -> On a new line at the end of this cell
            $renderer->setXy($renderer->getX() + $this->width, $renderer->getY() + $this->height + ($cP * 2));
            // Reset the last cell height for the next line
            $renderer->lastCellHeight = 0;
        }
    }
35769
public function display(core_backup_renderer $renderer) {

        // Get the resulting stored_file record.
        $type = $this->get_ui()->get_controller()->get_type();
        $courseid = $this->get_ui()->get_controller()->get_courseid();
        switch ($type) {
            case 'activity':
                $cmid = $this->get_ui()->get_controller()->get_id();
                $cm = get_coursemodule_from_id(null, $cmid, $courseid);
                $modcontext = context_module::instance($cm->id);
                $restorerul = new moodle_url('/backup/restorefile.php', array('contextid' => $modcontext->id));
                break;
            case 'course':
            default:
                $coursecontext = context_course::instance($courseid);
                $restorerul = new moodle_url('/backup/restorefile.php', array('contextid' => $coursecontext->id));
        }

        $output = '';
        $output .= $renderer->box_start();
        if (!empty($this->results['include_file_references_to_external_content'])) {
            $output .= $renderer->notification(get_string('filereferencesincluded', 'backup'), 'notifyproblem');
        }
        if (!empty($this->results['missing_files_in_pool'])) {
            $output .= $renderer->notification(get_string('missingfilesinpool', 'backup'), 'notifyproblem');
        }
        $output .= $renderer->notification(get_string('executionsuccess', 'backup'), 'notifysuccess');
        $output .= $renderer->continue_button($restorerul);
        $output .= $renderer->box_end();

        return $output;
    }
886782
public function addRenderer(RendererAbstract $renderer)
    {
        $extension = $renderer->getExtension();

        if (isset($this->renderer[$extension])) {
            return false;
        }
        
        $this->renderer[$extension] = $renderer;
        return true;
    }