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

UserResolutionException::__construct()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 5
nc 2
nop 2
dl 0
loc 10
rs 10
c 1
b 0
f 0
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