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

remote-object.php$0 ➔ call()   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 3
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
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
Coding Style introduced by
This class is not in CamelCase format.

Classes in PHP are usually named in CamelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. The whole name starts with a capital letter as well.

Thus the name database provider becomes DatabaseProvider.

Loading history...
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