Passed
Pull Request — master (#2)
by Alexander
01:11
created

ProxyHandler   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A onGet() 0 3 1
A onSet() 0 3 1
A onIsset() 0 3 1
A onCall() 0 3 1
A onUnset() 0 3 1
1
<?php
2
3
4
namespace Yiisoft\Proxy\Tests;
5
6
7
use Yiisoft\Proxy\ProxyHandlerInterface;
8
9
final class ProxyHandler implements ProxyHandlerInterface
10
{
11
    public array $calls = [];
12
13
    public function onGet(string $name, object $object): void
14
    {
15
        $this->calls[] = ['get', $name, $object];
16
    }
17
18
    public function onSet(string $name, $value, object $object): void
19
    {
20
        $this->calls[] = ['set', $name, $value, $object];
21
    }
22
23
    public function onIsset(string $name, object $object): void
24
    {
25
        $this->calls[] = ['isset', $name, $object];
26
    }
27
28
    public function onUnset(string $name, object $object): void
29
    {
30
        $this->calls[] = ['unset', $name, $object];
31
    }
32
33
    public function onCall(string $name, array $arguments, object $object): void
34
    {
35
        $this->calls[] = ['call', $name, $arguments, $object];
36
    }
37
}
38