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 ( 1ab5c9...d245d8 )
by Leonardo
03:25
created

SupportMenuPage::getContentToPrint()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 7
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 9
ccs 0
cts 6
cp 0
crap 6
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GraphQLAPI\GraphQLAPI\Admin\MenuPages;
6
7
use InvalidArgumentException;
8
use GraphQLAPI\GraphQLAPI\ContentProcessors\ContentParserOptions;
9
use GraphQLAPI\GraphQLAPI\Facades\ContentProcessors\MarkdownContentParserFacade;
10
11
/**
12
 * Support menu page
13
 */
14
class SupportMenuPage extends AbstractDocsMenuPage
15
{
16
    use OpenInModalTriggerMenuPageTrait;
17
18
    public function getMenuPageSlug(): string
19
    {
20
        return 'support';
21
    }
22
23
    protected function useTabpanelForContent(): bool
24
    {
25
        return true;
26
    }
27
28
    protected function getContentToPrint(): string
29
    {
30
        $markdownContentParser = MarkdownContentParserFacade::getInstance();
31
        try {
32
            return $markdownContentParser->getContent('support.md', '', [ContentParserOptions::TAB_CONTENT => true]);
33
        } catch (InvalidArgumentException $e) {
34
            return sprintf(
35
                '<p>%s</p>',
36
                \__('Oops, there was a problem loading the page', 'graphql-api')
37
            );
38
        }
39
    }
40
}
41