Completed
Pull Request — master (#44)
by Angelo
02:04
created

buildProxy.php ➔ buildProxy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 1
cts 1
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Moka\Factory;
5
6
use Moka\Exception\InvalidArgumentException;
7
use Moka\Exception\MockNotCreatedException;
8
use Moka\Generator\ProxyGenerator;
9
use Moka\Proxy\ProxyInterface;
10
use Moka\Strategy\MockingStrategyInterface;
11
12
/**
13
 * @param string $fqcn
14
 * @param MockingStrategyInterface $mockingStrategy
15
 * @return ProxyInterface
16
 *
17
 * @throws \ReflectionException
18
 * @throws InvalidArgumentException
19
 * @throws MockNotCreatedException
20
 */
21
function buildProxy(string $fqcn, MockingStrategyInterface $mockingStrategy): ProxyInterface
22
{
23 8
    return (new ProxyGenerator($mockingStrategy))->get($fqcn);
24
}
25