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
Push — master ( a910b0...a0e75b )
by
unknown
04:10
created

BlogJsBlockListener::onBlockEvent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 7
c 1
b 1
f 0
dl 0
loc 12
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Odiseo\SyliusBlogPlugin\Block;
6
7
use Sonata\BlockBundle\Event\BlockEvent;
8
use Sonata\BlockBundle\Model\Block;
9
10
final class BlogJsBlockListener
11
{
12
    /**
13
     * @param BlockEvent $event
14
     */
15
    public function onBlockEvent(BlockEvent $event): void
16
    {
17
        $template = '@OdiseoSyliusBlogPlugin/Admin/_blog_js.html.twig';
18
19
        $block = new Block();
20
        $block->setId(uniqid('', true));
21
        $block->setSettings(array_replace($event->getSettings(), [
22
            'template' => $template,
23
        ]));
24
        $block->setType('sonata.block.service.template');
25
26
        $event->addBlock($block);
27
    }
28
}
29