Passed
Pull Request — master (#55)
by
unknown
08:16
created

InvalidOperationException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 23
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getInvalidOperation() 0 3 1
A __construct() 0 9 1
A getOperationObject() 0 3 1
1
<?php
2
3
namespace Swaggest\JsonDiff;
4
5
6
use Throwable;
7
8
class InvalidOperationException extends Exception
9
{
10
    private object $operationObject;
11
12
    public function __construct(
13
        object    $operationObject,
14
        string    $message = '',
15
        int       $code = 0,
16
        Throwable $previous = null
17
    )
18
    {
19
        parent::__construct($message, $code, $previous);
20
        $this->operationObject = $operationObject;
21
    }
22
23
    public function getInvalidOperation(): string
24
    {
25
        return $this->operationObject->op;
26
    }
27
28
    public function getOperationObject(): object
29
    {
30
        return $this->operationObject;
31
    }
32
}
33