MyProxiedClass::sayHello()   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 StaticAnalysis\RemoteObject;
4
5
use ProxyManager\Factory\LazyLoadingValueHolderFactory;
6
use ProxyManager\Factory\NullObjectFactory;
7
use ProxyManager\Factory\RemoteObject\AdapterInterface;
8
use ProxyManager\Factory\RemoteObjectFactory;
9
use ProxyManager\Proxy\LazyLoadingInterface;
10
11
require_once __DIR__ . '/../../vendor/autoload.php';
12
13
class MyProxiedClass
14
{
15
    public function sayHello() : string
16
    {
17
        return 'Hello!';
18
    }
19
}
20
21
$adapter = new class implements AdapterInterface
22
{
23
    public function call(string $wrappedClass, string $method, array $params = [])
24
    {
25
        return 'ohai';
26
    }
27
};
28
29
echo (new RemoteObjectFactory($adapter))
30
    ->createProxy(new MyProxiedClass())
31
    ->sayHello();
32
33
echo (new RemoteObjectFactory($adapter))
34
    ->createProxy(MyProxiedClass::class)
35
    ->sayHello();
36