DefaultContextFactory::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
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