GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( b38aca...ed3c2e )
by Leonardo
06:08 queued 57s
created

AbstractDocAboutMenuPage::getContentToPrint()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 10
nc 2
nop 0
dl 0
loc 12
rs 9.9332
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GraphQLAPI\GraphQLAPI\Admin\MenuPages;
6
7
use InvalidArgumentException;
8
use GraphQLAPI\GraphQLAPI\General\RequestParams;
9
use GraphQLAPI\GraphQLAPI\Facades\ContentProcessors\MarkdownContentParserFacade;
10
11
/**
12
 * Open documentation within the About page
13
 */
14
abstract class AbstractDocAboutMenuPage extends AbstractDocsMenuPage
15
{
16
    protected function openInModalWindow(): bool
17
    {
18
        return true;
19
    }
20
21
    protected function getContentToPrint(): string
22
    {
23
        $doc = $_REQUEST[RequestParams::DOC];
24
        $markdownContentParser = MarkdownContentParserFacade::getInstance();
25
        try {
26
            return $markdownContentParser->getContent($doc);
27
        } catch (InvalidArgumentException $e) {
28
            return sprintf(
29
                '<p>%s</p>',
30
                sprintf(
31
                    \__('Page \'%s\' does not exist', 'graphql-api'),
32
                    $doc
33
                )
34
            );
35
        }
36
    }
37
}
38