DefaultGroupEnricher::process()   A
last analyzed

Complexity

Conditions 4
Paths 3

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 4
eloc 4
c 1
b 0
f 0
nc 3
nop 2
dl 0
loc 8
ccs 5
cts 5
cp 1
crap 4
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DMK\MKSamlAuth\Enricher;
6
7
use DMK\MKSamlAuth\Model\FrontendUser;
8
9
class DefaultGroupEnricher implements EnricherInterface
10
{
11 3
    public function process(FrontendUser $user, array $context)
12
    {
13 3
        if (null !== $user->getUid()) {
14 1
            return;
15
        }
16
17 2
        if ($context['idp']['default_groups_enable'] && $context['idp']['default_groups']) {
18 1
            $user->setProperty('usergroup', $context['idp']['default_groups']);
19
        }
20 2
    }
21
}
22