Completed
Pull Request — master (#27)
by Harry
02:14
created

InvalidUidSignatureException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 0
cts 10
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 5
crap 2
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
    public function __construct($uid, $expected, $signature, ResponseInterface $response, Exception $previous = null)
29
    {
30
        $message = sprintf(
31
            "The supplied signature for uid: %s does not match.\n Expected '%s'\n Supplied '%s'",
32
            $uid,
33
            $expected,
34
            $signature
35
        );
36
37
        parent::__construct($response, $message, $previous);
38
    }
39
}
40