Test Failed
Push — master ( 59e8b7...7608ba )
by Florian
03:44
created

Exception::setMessageVars()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
declare(strict_types = 1);
3
/**
4
 * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
5
 * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
6
 *
7
 * Licensed under The MIT License
8
 * For full copyright and license information, please see the LICENSE.txt
9
 * Redistributions of files must retain the above copyright notice.
10
 *
11
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
12
 * @link          https://cakephp.org CakePHP(tm) Project
13
 * @since         1.0.0
14
 * @license       https://opensource.org/licenses/mit-license.php MIT License
15
 */
16
namespace Phauthentic\Authorization\Exception;
17
18
use RuntimeException;
19
use Throwable;
20
21
/**
22
 * Exception
23
 */
24
class Exception extends RuntimeException
25
{
26
    /**
27
     * @var string
28
     */
29
    protected $messageTemplate = '';
30
31
    /**
32
     * Method to format the predefined message template and use it as message
33
     *
34
     * @param array $values Values
35
     * @return $this
36
     */
37
    public function setMessageVars(array $values = [])
38
    {
39
        $this->message = vsprintf($this->messageTemplate, $values);
40
41
        return $this;
42
    }
43
}
44