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 ( 5e78ac...c92182 )
by Leonardo
03:26
created

AbstractDocsMenuPage::getDivClasses()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
c 0
b 0
f 0
nc 2
nop 0
dl 0
loc 7
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GraphQLAPI\GraphQLAPI\Admin\MenuPages;
6
7
use GraphQLAPI\GraphQLAPI\Admin\MenuPages\AbstractMenuPage;
8
9
/**
10
 * Docs menu page
11
 */
12
abstract class AbstractDocsMenuPage extends AbstractMenuPage
13
{
14
    use GraphQLAPIMenuPageTrait, OpenInModalMenuPageTrait, UseTabpanelMenuPageTrait;
15
16
    public function print(): void
17
    {
18
        ?>
19
        <div
20
            class="<?php echo implode(' ', $this->getDivClasses()) ?>"
21
        >
22
            <?php echo $this->getContentToPrint() ?>
23
        </div>
24
        <?php
25
    }
26
27
    /**
28
     * Classes to add to the output <div>
29
     *
30
     * @return string[]
31
     */
32
    protected function getDivClasses(): array
33
    {
34
        $classes = [];
35
        if ($this->openInModalWindow()) {
36
            $classes[] = 'modal-window-content-wrapper';
37
        }
38
        return $classes;
39
    }
40
41
    abstract protected function getContentToPrint(): string;
42
43
    protected function openInModalWindow(): bool
44
    {
45
        return false;
46
    }
47
48
    protected function useTabpanelForContent(): bool
49
    {
50
        return false;
51
    }
52
53
    /**
54
     * Enqueue the required assets and initialize the localized scripts
55
     *
56
     * @return void
57
     */
58
    protected function enqueueAssets(): void
59
    {
60
        parent::enqueueAssets();
61
62
        /**
63
         * Add styles to open the page in a modal
64
         */
65
        if ($this->openInModalWindow()) {
66
            $this->enqueueModalAssets();
67
        }
68
69
        /**
70
         * Add styles/scripts to use a tabpanel
71
         */
72
        if ($this->useTabpanelForContent()) {
73
            $this->enqueueTabpanelAssets();
74
        }
75
    }
76
}
77