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.

AboutMenuPage::enqueueAssets()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GraphQLAPI\GraphQLAPI\ConditionalOnEnvironment\Admin\Services\MenuPages;
6
7
use GraphQLAPI\GraphQLAPI\ConditionalOnEnvironment\Admin\Services\Helpers\MenuPageHelper;
8
use GraphQLAPI\GraphQLAPI\ContentProcessors\ContentParserOptions;
9
use GraphQLAPI\GraphQLAPI\Facades\ContentProcessors\MarkdownContentParserFacade;
10
use InvalidArgumentException;
11
12
/**
13
 * About menu page
14
 */
15
class AboutMenuPage extends AbstractDocsMenuPage
16
{
17
    use OpenInModalTriggerMenuPageTrait;
18
19
    protected MenuPageHelper $menuPageHelper;
20
21
    function __construct(MenuPageHelper $menuPageHelper)
22
    {
23
        $this->menuPageHelper = $menuPageHelper;
24
    }
25
26
    public function getMenuPageSlug(): string
27
    {
28
        return 'about';
29
    }
30
31
    protected function useTabpanelForContent(): bool
32
    {
33
        return true;
34
    }
35
36
    /**
37
     * Validate the param also
38
     */
39
    protected function isCurrentScreen(): bool
40
    {
41
        return !$this->menuPageHelper->isDocumentationScreen() && parent::isCurrentScreen();
42
    }
43
44
    protected function getContentToPrint(): string
45
    {
46
        $markdownContentParser = MarkdownContentParserFacade::getInstance();
47
        try {
48
            return $markdownContentParser->getContent('about.md', '', [ContentParserOptions::TAB_CONTENT => true]);
49
        } catch (InvalidArgumentException $e) {
50
            return sprintf(
51
                '<p>%s</p>',
52
                \__('Oops, there was a problem loading the page', 'graphql-api')
53
            );
54
        }
55
    }
56
57
    /**
58
     * Enqueue the required assets
59
     */
60
    protected function enqueueAssets(): void
61
    {
62
        parent::enqueueAssets();
63
64
        $this->enqueueModalTriggerAssets();
65
    }
66
}
67