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   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 36
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A createBold() 0 4 1
A __invoke() 0 4 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