InvalidFormatException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
1
<?php
2
namespace Consolidation\OutputFormatters\Exception;
3
4
/**
5
 * Represents an incompatibility between the output data and selected formatter.
6
 */
7
class InvalidFormatException extends AbstractDataFormatException
8
{
9
    public function __construct($format, $data, $validFormats)
10
    {
11
        $dataDescription = static::describeDataType($data);
12
        $message = "The format $format cannot be used with the data produced by this command, which was $dataDescription.  Valid formats are: " . implode(',', $validFormats);
13
        parent::__construct($message, 1);
14
    }
15
}
16