JsonMatcherAwareTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setJsonMatcher() 0 4 1
A json() 0 4 1
1
<?php
2
3
namespace JsonSpec\Behat\Context\Traits;
4
5
use Fesor\JsonMatcher\JsonMatcherFactory;
6
7
trait JsonMatcherAwareTrait
8
{
9
10
    /**
11
     * @var JsonMatcherFactory
12
     */
13
    private $matcherFactory;
14
15
    /**
16
     * @param JsonMatcherFactory $matcherFactory
17
     */
18
    public function setJsonMatcher(JsonMatcherFactory $matcherFactory)
19
    {
20
        $this->matcherFactory = $matcherFactory;
21
    }
22
23
    /**
24
     * @param $json
25
     * @return \Fesor\JsonMatcher\JsonMatcher
26
     */
27
    protected function json($json)
28
    {
29
        return $this->matcherFactory->create($json);
30
    }
31
32
}
33