Test Failed
Push — master ( ecd78b...d05c81 )
by Kirill
02:43
created

IntValue   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 36
loc 36
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 4 4 1
A toString() 4 4 1
A getValue() 4 4 1
A __toString() 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
 * This file is part of Railt package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace Railt\SDL\Frontend\IR\Value;
11
12
/**
13
 * Class IntValue
14
 */
15 View Code Duplication
class IntValue extends AbstractValue
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...
16
{
17
    /**
18
     * FloatValue constructor.
19
     * @param int $value
20
     * @param int $offset
21
     */
22
    public function __construct(int $value, int $offset = 0)
23
    {
24
        parent::__construct($value, $offset);
25
    }
26
27
    /**
28
     * @return string
29
     */
30
    public function toString(): string
31
    {
32
        return (string)$this->getValue();
33
    }
34
35
    /**
36
     * @return int
37
     */
38
    public function getValue(): int
39
    {
40
        return parent::getValue();
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function __toString(): string
47
    {
48
        return '(int)' . parent::__toString();
49
    }
50
}
51