DefaultContextFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A newContext() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of expect package.
5
 *
6
 * (c) Noritaka Horio <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
namespace expect\context;
12
13
use expect\ContextFactory;
14
use expect\MatcherFactory;
15
use expect\ResultReporter;
16
17
class DefaultContextFactory implements ContextFactory
18
{
19
    private $factory;
20
    private $reporter;
21
22
    public function __construct(MatcherFactory $factory, ResultReporter $reporter)
23
    {
24
        $this->factory = $factory;
25
        $this->reporter = $reporter;
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function newContext()
32
    {
33
        return new EvaluateContext($this->factory, $this->reporter);
34
    }
35
}
36