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.
Completed
Pull Request — master (#89)
by Tomasz
01:14
created

RewriteWrapEventHandler::__invoke()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
1
<?php
2
namespace Thunder\Shortcode\EventHandler;
3
4
use Thunder\Shortcode\Event\RewriteReplacementsEvent;
5
6
/**
7
 * @author Tomasz Kowalczyk <[email protected]>
8
 */
9
final class RewriteWrapEventHandler
10
{
11
    /** @var string */
12
    private $prefix;
13
    /** @var string */
14
    private $suffix;
15
16
    /**
17
     * @param string $prefix
18
     * @param string $suffix
19
     */
20 1
    public function __construct($prefix, $suffix)
21
    {
22 1
        $this->prefix = $prefix;
23 1
        $this->suffix = $suffix;
24 1
    }
25
26 1
    public function __invoke(RewriteReplacementsEvent $event)
27
    {
28 1
        foreach($event->getReplacements() as $replacement) {
29 1
            $event->addRewritten($replacement->withReplacement($this->prefix.$replacement->getReplacement().$this->suffix));
30 1
        }
31 1
    }
32
}
33