Completed
Pull Request — master (#467)
by Marco
25:15
created

MyProxiedClass::sayHello()   A

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\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