AbstractMenuPage   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 37
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getPosition() 0 3 1
A getMenuTitle() 0 3 1
A __construct() 0 20 1
1
<?php
2
3
namespace Leonidas\Library\Admin\Component\Page\Abstracts;
4
5
use Leonidas\Contracts\Admin\Component\Page\AdminPageLayoutInterface;
6
use Leonidas\Contracts\Admin\Component\Page\AdminTitleResolverInterface;
7
use Leonidas\Contracts\Admin\Component\Page\LoadErrorPageInterface;
8
9
abstract class AbstractMenuPage extends AbstractAdminPage
10
{
11
    protected string $menuTitle = '';
12
13
    protected int $position;
14
15
    public function __construct(
16
        string $pageTitle,
17
        string $menuTitle,
18
        string $menuSlug,
19
        int $position,
20
        AdminPageLayoutInterface $layout,
21
        LoadErrorPageInterface $loadErrorPage,
22
        ?string $capability = null,
23
        ?AdminTitleResolverInterface $adminTitleResolver = null
24
    ) {
25
        $this->menuTitle = $menuTitle;
26
        $this->position = $position;
27
28
        parent::__construct(
29
            $pageTitle,
30
            $menuSlug,
31
            $layout,
32
            $loadErrorPage,
33
            $capability,
34
            $adminTitleResolver
35
        );
36
    }
37
38
    public function getMenuTitle(): string
39
    {
40
        return $this->menuTitle;
41
    }
42
43
    public function getPosition(): int
44
    {
45
        return $this->position;
46
    }
47
}
48