Passed
Push — main ( ef112d...d39948 )
by Pieter
03:42
created

DefaultValueNotInEnum::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 6
rs 10
1
<?php
2
3
4
namespace Apie\OpenapiSchema\Exceptions;
5
6
use Apie\Core\Exceptions\ApieException;
7
8
class DefaultValueNotInEnum extends ApieException
9
{
10
    public function __construct(string $defaultValue, string... $enums)
11
    {
12
        parent::__construct(500, sprintf(
13
            'The default value "%s" is not found in the enum. It should be one of %s',
14
            $defaultValue,
15
            trim(json_encode($enums), '[]')
16
        ));
17
    }
18
}