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.

WrapHandler::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
namespace Thunder\Shortcode\Handler;
3
4
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
5
6
/**
7
 * @author Tomasz Kowalczyk <[email protected]>
8
 */
9
final class WrapHandler
10
{
11
    /** @var string */
12
    private $before;
13
    /** @var string */
14
    private $after;
15
16
    /**
17
     * @param string $before
18
     * @param string $after
19
     */
20 19
    public function __construct($before, $after)
21
    {
22 19
        $this->before = $before;
23 19
        $this->after = $after;
24 19
    }
25
26
    /** @return self */
27 19
    public static function createBold()
28
    {
29 19
        return new self('<b>', '</b>');
30
    }
31
32
    /**
33
     * [b]content[b]
34
     * [strong]content[/strong]
35
     *
36
     * @param ShortcodeInterface $shortcode
37
     *
38
     * @return string
39
     */
40 2
    public function __invoke(ShortcodeInterface $shortcode)
41
    {
42 2
        return $this->before.(string)$shortcode->getContent().$this->after;
43
    }
44
}
45