EndpointBuildingException::getBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace hiapi\endpoints\Exception;
4
5
use hiapi\endpoints\EndpointBuilderInterface;
6
use hiapi\exceptions\ConfigurationException;
7
8
class EndpointBuildingException extends ConfigurationException
9
{
10
    /**
11
     * @var EndpointBuilderInterface|null
12
     */
13
    protected $builder;
14
15
    public static function fromBuilder(string $message, EndpointBuilderInterface $builder)
16
    {
17
        $self = new static($message);
18
        $self->builder = $builder;
19
20
        return $self;
21
    }
22
23
    public function getBuilder(): ?EndpointBuilderInterface
24
    {
25
        return $this->builder;
26
    }
27
}
28