RedirectInlineAction   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 88.89%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 8
c 1
b 0
f 0
dl 0
loc 25
ccs 8
cts 9
cp 0.8889
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 3
A component() 0 3 1
A customGlobalData() 0 4 1
1
<?php
2
3
4
namespace UserAdmin\IndexPage\Actions\InlineActions;
5
6
use UserAdmin\IndexPage\Actions\AbstractInlineAction;
7
8
class RedirectInlineAction extends AbstractInlineAction
9
{
10
    public ?string $redirectUrl = null;
11
12 1
    public function __construct(...$args)
13
    {
14 1
        parent::__construct(...$args);
15
16 1
        if (!empty($args[1]) && is_string($args[1])) {
17
            $this->redirectUrl = $args[1];
18
        }
19 1
    }
20
21
    /**
22
     * @inheritDoc
23
     */
24 1
    public function component(): string
25
    {
26 1
        return 'index-inline-action-redirect';
27
    }
28
29 1
    public function customGlobalData(): array
30
    {
31
        return [
32 1
            'url' => $this->redirectUrl,
33
        ];
34
    }
35
}
36