Passed
Pull Request — master (#793)
by Alexander
10:27 queued 08:06
created

AbstractContext::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Logger\Context;
6
7
use Throwable;
8
use Yiisoft\Db\Logger\ContextInterface;
9
10
abstract class AbstractContext implements ContextInterface
11
{
12
    private Throwable|null $exception = null;
13
14
    public function __construct(private string $methodName)
15
    {
16
    }
17
18
    public function getMethodName(): string
19
    {
20
        return $this->methodName;
21
    }
22
23
    public function setException(Throwable $e): static
24
    {
25
        $this->exception = $e;
26
        return $this;
27
    }
28
29
    public function getException(): Throwable|null
30
    {
31
        return $this->exception;
32
    }
33
}
34