InvalidUidSignatureException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 5
dl 0
loc 10
ccs 7
cts 7
cp 1
crap 1
rs 10
1
<?php
2
/**
3
 * This file is part of graze/gigya-client
4
 *
5
 * Copyright (c) 2016 Nature Delivered Ltd. <https://www.graze.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license https://github.com/graze/gigya-client/blob/master/LICENSE.md
11
 * @link    https://github.com/graze/gigya-client
12
 */
13
14
namespace Graze\Gigya\Exception;
15
16
use Exception;
17
use Graze\Gigya\Response\ResponseInterface;
18
19
class InvalidUidSignatureException extends ResponseException
20
{
21
    /**
22
     * @param string            $uid
23
     * @param string            $expected
24
     * @param string            $signature
25
     * @param ResponseInterface $response
26
     * @param Exception|null    $previous
27
     */
28 2
    public function __construct($uid, $expected, $signature, ResponseInterface $response, Exception $previous = null)
29
    {
30 2
        $message = sprintf(
31 2
            "The supplied signature for uid: %s does not match.\n Expected '%s'\n Supplied '%s'",
32 2
            $uid,
33 2
            $expected,
34 2
            $signature
35
        );
36
37 2
        parent::__construct($response, $message, $previous);
38 2
    }
39
}
40