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.
Passed
Push — master ( aad278...8da90f )
by
unknown
04:35
created

BannerCssBlockListener::onBlockEvent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 7
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 12
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Odiseo\SyliusBannerPlugin\Block;
6
7
use Sonata\BlockBundle\Event\BlockEvent;
8
use Sonata\BlockBundle\Model\Block;
9
10
final class BannerCssBlockListener
11
{
12
    /**
13
     * @param BlockEvent $event
14
     */
15
    public function onBlockEvent(BlockEvent $event): void
16
    {
17
        $template = '@OdiseoSyliusBannerPlugin/Shop/Banner/_banner_css.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