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   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
dl 0
loc 19
rs 10
c 1
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getContentToPrint() 0 12 2
A openInModalWindow() 0 3 1
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