AddUserTab::beforeToHtml()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 14
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Firegento\DevDashboard\Plugin;
4
5
use Firegento\DevDashboard\Block\UserEditTab;
6
7
class AddUserTab
8
{
9
10
    /**
11
     * @param \Magento\User\Block\User\Edit\Tabs $subject
12
     * @throws \Exception
13
     * @throws \Magento\Framework\Exception\LocalizedException
14
     */
15
    public function beforeToHtml(\Magento\User\Block\User\Edit\Tabs $subject)
16
    {
17
        $subject->addTabAfter(
18
            'devdashboardconfig',
19
            [
20
                'label' => __('Dashboard Config'),
21
                'title' => __('Dashboard Config'),
22
                'content' => $subject->getLayout()->createBlock(UserEditTab::class)->toHtml(),
23
                'active' => true
24
            ],
25
            'roles_section'
26
        );
27
28
        return [];
29
    }
30
}
31