Completed
Push — master ( 284884...b70f30 )
by Kamil
20:25
created

Mocker   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 3
c 1
b 1
f 0
lcom 0
cbo 2
dl 0
loc 31
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A mockCollaborator() 0 4 1
A mockService() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sylius\Behat;
13
14
use PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer;
15
16
/**
17
 * @author Arkadiusz Krakowiak <[email protected]>
18
 */
19
class Mocker implements MockerInterface
20
{
21
    /**
22
     * @var MockerContainer
23
     */
24
    private $container;
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function __construct(MockerContainer $container)
30
    {
31
        $this->container = $container;
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function mockCollaborator($className)
38
    {
39
        return \Mockery::mock($className);
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function mockService($serviceId, $className)
46
    {
47
        return $this->container->mock($serviceId, $className);
48
    }
49
}
50