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   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 8
c 1
b 0
f 1
dl 0
loc 17
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A onBlockEvent() 0 12 1
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