Completed
Push — master ( 17da57...0d4fd4 )
by Denis
02:07
created

ParserContainer   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 40
loc 40
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 5 5 1
A getParser() 4 4 1
A getValue() 4 4 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace PhpJsonRpc\Server\RequestParser;
4
5
use PhpJsonRpc\Common\Interceptor\AbstractContainer;
6
use PhpJsonRpc\Server\RequestParser;
7
8 View Code Duplication
class ParserContainer extends AbstractContainer
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    /**
11
     * @var RequestParser
12
     */
13
    private $parser;
14
15
    /**
16
     * @var mixed
17
     */
18
    private $value;
19
20
    /**
21
     * PreParseContainer constructor.
22
     *
23
     * @param RequestParser $parser
24
     * @param mixed         $value
25
     */
26
    public function __construct(RequestParser $parser, $value)
27
    {
28
        $this->parser = $parser;
29
        $this->value  = $value;
30
    }
31
32
    /**
33
     * @return RequestParser
34
     */
35
    public function getParser(): RequestParser
36
    {
37
        return $this->parser;
38
    }
39
40
    /**
41
     * @return mixed
42
     */
43
    public function getValue()
44
    {
45
        return $this->value;
46
    }
47
}
48