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   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 23
ccs 0
cts 10
cp 0
rs 10
wmc 4

3 Methods

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