MyProxiedClass   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 7
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A sayHello() 0 4 1
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