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

DefaultValueNotInEnum   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 8
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
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
}