Observation::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 3
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stratadox\ObservationQueue;
6
7
class Observation
8
{
9
    private $observer;
10
    private $method;
11
    private $parameters;
12
13
    public function __construct($observer, string $method, ...$parameters)
14
    {
15
        $this->observer = $observer;
16
        $this->method = $method;
17
        $this->parameters = $parameters;
18
    }
19
20
    public function trigger() : void
21
    {
22
        $this->observer->{$this->method}(...$this->parameters);
23
    }
24
}
25