Completed
Push — master ( 70cb44...646998 )
by Ivannis Suárez
05:28
created

MappingException::withMessage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 1
eloc 5
nc 1
nop 3
1
<?php
2
/**
3
 * This file is part of the Cubiche package.
4
 *
5
 * Copyright (c) Cubiche
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace Cubiche\Core\Validator\Mapping\Exception;
11
12
/**
13
 * MappingException class.
14
 *
15
 * @author Ivannis Suárez Jerez <[email protected]>
16
 */
17
class MappingException extends \Exception
18
{
19
    /**
20
     * @param string $message
21
     * @param string $className
22
     * @param string $fieldName
23
     *
24
     * @return static
25
     */
26
    public static function withMessage($message, $className, $fieldName)
27
    {
28
        return new static(sprintf(
29
            $message,
30
            $className,
31
            $fieldName
32
        ));
33
    }
34
}
35