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 ( aac044...cc3c72 )
by Leonardo
14:28
created

SupportMenuPage   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A useTabpanelForContent() 0 3 1
A getContentToPrint() 0 9 2
A getMenuPageSlug() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GraphQLAPI\GraphQLAPI\ConditionalOnEnvironment\Admin\Services\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 false;
26
    }
27
28
    protected function getContentToPrint(): string
29
    {
30
        $markdownContentParser = MarkdownContentParserFacade::getInstance();
31
        try {
32
            return $markdownContentParser->getContent('support.md', '', [ContentParserOptions::TAB_CONTENT => false]);
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