Passed
Push — master ( 6ea451...1ef48a )
by Anton
01:35
created

PromiseFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A proxy() 0 3 1
1
<?php
2
declare(strict_types=1);
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
namespace Cycle\ORM\Promise;
11
12
use Cycle\ORM\ORMInterface;
13
use Cycle\ORM\ProxyFactoryInterface;
14
15
/**
16
 * Returns PromiseOne for all entities.
17
 */
18
class PromiseFactory implements ProxyFactoryInterface
19
{
20
    /**
21
     * @param ORMInterface $orm
22
     * @param string       $role
23
     * @param array        $scope
24
     * @return ReferenceInterface|null
25
     */
26
    public function proxy(ORMInterface $orm, string $role, array $scope): ?ReferenceInterface
27
    {
28
        return new PromiseOne($orm, $role, $scope);
29
    }
30
}