MissingArgumentException::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 6
cts 6
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 3
crap 2
1
<?php
2
3
namespace Trello\Exception;
4
5
/**
6
 * MissingArgumentException
7
 *
8
 * @author Joseph Bielawski <[email protected]>
9
 */
10
class MissingArgumentException extends ErrorException
11
{
12
    /**
13
     * @param string $required
14
     */
15 21
    public function __construct($required, $code = 0, $previous = null)
16
    {
17 21
        if (is_string($required)) {
18 21
            $required = array($required);
19 21
        }
20
21 21
        parent::__construct(sprintf('One or more of required ("%s") parameters are missing!', implode('", "', $required)), $code, $previous);
22 21
    }
23
}
24