Completed
Pull Request — master (#467)
by Marco
24:20
created

MyProxiedClass   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A sayHello() 0 4 1
1
<?php
2
3
namespace StaticAnalysis\NullObject;
4
5
use ProxyManager\Factory\LazyLoadingValueHolderFactory;
6
use ProxyManager\Factory\NullObjectFactory;
7
use ProxyManager\Proxy\LazyLoadingInterface;
8
9
require_once __DIR__ . '/../../vendor/autoload.php';
10
11
class MyProxiedClass
12
{
13
    /** @return string|null return type cannot be enforced on a null object - nothing is ever returned */
14
    public function sayHello()
15
    {
16
        return 'Hello!';
17
    }
18
}
19
20
echo (new NullObjectFactory())
21
    ->createProxy(MyProxiedClass::class)
22
    ->sayHello();
23
24
echo (new NullObjectFactory())
25
    ->createProxy(new MyProxiedClass())
26
    ->sayHello();
27