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.

Code Duplication    Length = 6-6 lines in 2 locations

tests/EventsTest.php 1 location

@@ 65-70 (lines=6) @@
62
63
        $events = new EventContainer();
64
        $events->addListener(Events::REPLACE_SHORTCODES, function(ReplaceShortcodesEvent $event) {
65
            $event->setResult(array_reduce(array_reverse($event->getReplacements()), function($state, ReplacedShortcode $r) {
66
                $offset = $r->getOffset();
67
                $length = mb_strlen($r->getText());
68
69
                return mb_substr($state, 0, $offset).$r->getReplacement().mb_substr($state, $offset + $length);
70
            }, $event->getText()));
71
        });
72
73
        $processor = new Processor(new RegularParser(), $handlers);

src/Processor/Processor.php 1 location

@@ 117-122 (lines=6) @@
114
115
    private function applyReplaces($text, array $replaces)
116
    {
117
        return array_reduce(array_reverse($replaces), function($state, ReplacedShortcode $s) {
118
            $offset = $s->getOffset();
119
            $length = mb_strlen($s->getText());
120
121
            return mb_substr($state, 0, $offset).$s->getReplacement().mb_substr($state, $offset + $length);
122
        }, $text);
123
    }
124
125
    private function processHandler(ParsedShortcodeInterface $parsed, ProcessorContext $context, $handler)