Completed
Push — master ( 48e5b8...eb0757 )
by Tobias
20:40
created

MissingRequiredParameter::create()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 2
1
<?php
2
3
/*
4
 * Copyright (C) 2013 Mailgun
5
 *
6
 * This software may be modified and distributed under the terms
7
 * of the MIT license. See the LICENSE file for details.
8
 */
9
10
namespace Mailgun\Message\Exceptions;
11
12
use Mailgun\Exception;
13
14
class MissingRequiredParameter extends \Exception implements Exception
15
{
16
    public static function create($parameter, $message = null)
17
    {
18
        if (null === $message) {
19
            $message = 'The parameters passed to the API were invalid. Please specify "%s".';
20
        }
21
22
        return new self(sprintf($message, $parameter));
23
    }
24
}
25