Passed
Push — master ( 91df3a...c0064a )
by Anton
01:58
created

PromiseFactory::promise()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
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\PromiseFactoryInterface;
14
15
/**
16
 * Returns PromiseOne for all entities.
17
 */
18
class PromiseFactory implements PromiseFactoryInterface
19
{
20
    /**
21
     * @param ORMInterface $orm
22
     * @param string       $role
23
     * @param array        $scope
24
     * @return ReferenceInterface|null
25
     */
26
    public function promise(ORMInterface $orm, string $role, array $scope): ?ReferenceInterface
27
    {
28
        return new PromiseOne($orm, $role, $scope);
29
    }
30
}