Completed
Push — master ( 568d87...b0a8a2 )
by Fabian
28s queued 11s
created

User   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 6
c 1
b 0
f 1
dl 0
loc 14
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A afterLoad() 0 5 1
A __construct() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Firegento\DevDashboard\Plugin\Model;
5
6
class User
7
{
8
    protected $_configRepository;
9
10
    public function __construct(\Firegento\DevDashboard\Model\ConfigRepository $configRepository)
11
    {
12
        $this->_configRepository = $configRepository;
13
    }
14
15
    public function afterLoad(\Magento\User\Model\User $subject, $result)
16
    {
17
        $userConfig = $this->_configRepository->getByUserId($subject->getId());
18
        $result->setData('use_devdashboard', $userConfig->getData('use_devdashboard'));
19
        return $result;
20
    }
21
}
22