GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

ParsedShortcode::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 9
Ratio 100 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 0
Metric Value
dl 9
loc 9
ccs 8
cts 8
cp 1
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 3
crap 1
1
<?php
2
namespace Thunder\Shortcode\Shortcode;
3
4
/**
5
 * @author Tomasz Kowalczyk <[email protected]>
6
 */
7
final class ParsedShortcode extends AbstractShortcode implements ParsedShortcodeInterface
8
{
9
    /** @var string */
10
    private $text;
11
    /** @var int */
12
    private $offset;
13
14
    /**
15
     * @param string $text
16
     * @param int $offset
17
     */
18 187 View Code Duplication
    public function __construct(ShortcodeInterface $shortcode, $text, $offset)
0 ignored issues
show
Duplication introduced by
This method 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...
19
    {
20 187
        $this->name = $shortcode->getName();
21 187
        $this->parameters = $shortcode->getParameters();
22 187
        $this->content = $shortcode->getContent();
23 187
        $this->bbCode = $shortcode->getBbCode();
24 187
        $this->text = $text;
25 187
        $this->offset = $offset;
26 187
    }
27
28 1
    public function withContent($content)
29
    {
30 1
        $self = clone $this;
31 1
        $self->content = $content;
32
33 1
        return $self;
34
    }
35
36
    /** @return string */
37 178
    public function getText()
38
    {
39 178
        return $this->text;
40
    }
41
42
    /** @return int */
43 178
    public function getOffset()
44
    {
45 178
        return $this->offset;
46
    }
47
}
48