Test Failed
Pull Request — master (#88)
by Artem
04:05
created

UserResolutionException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 3
1
<?php
2
3
namespace Slides\Saml2\Exceptions;
4
5
use Illuminate\Support\Facades\Log;
6
use Slides\Saml2\Saml2User;
7
8
class UserResolutionException extends \InvalidArgumentException
9
{
10
    /**
11
     * @param string $message
12
     * @param Saml2User|null $saml2User
13
     */
14
    public function __construct(string $message, Saml2User $saml2User = null)
15
    {
16
        if ($saml2User && config('saml2.debug')) {
0 ignored issues
show
Bug introduced by
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

16
        if ($saml2User && /** @scrutinizer ignore-call */ config('saml2.debug')) {
Loading history...
17
            Log::debug('[Saml2] User resolution failed', [
18
                'message' => $message,
19
                'attributes' => $saml2User->getAttributes()
20
            ]);
21
        }
22
23
        parent::__construct($message);
24
    }
25
}
26