Test Setup Failed
Pull Request — master (#4522)
by Craig
08:26 queued 03:47
created

BlocksExtension::showBlock()   B

Complexity

Conditions 7
Paths 5

Size

Total Lines 29
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 7
eloc 19
nc 5
nop 2
dl 0
loc 29
rs 8.8333
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Zikula package.
7
 *
8
 * Copyright Zikula - https://ziku.la/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Zikula\BlocksModule\Twig\Extension;
15
16
use Twig\Extension\AbstractExtension;
17
use Twig\TwigFunction;
18
use Twig\TwigTest;
19
use Zikula\BlocksModule\Collectible\PendingContentCollectible;
20
use Zikula\BlocksModule\Twig\Runtime\BlocksRuntime;
21
22
class BlocksExtension extends AbstractExtension
23
{
24
    public function getFunctions()
25
    {
26
        return [
27
            new TwigFunction('showblockposition', [BlocksRuntime::class, 'showBlockPosition'], ['is_safe' => ['html']]),
28
            new TwigFunction('showblock', [BlocksRuntime::class, 'showBlock'], ['is_safe' => ['html']]),
29
            new TwigFunction('positionavailable', [BlocksRuntime::class, 'isPositionAvailable']),
30
        ];
31
    }
32
33
    public function getTests()
34
    {
35
        return [
36
            new TwigTest('pendingContentCollectible', function ($obj) { return $obj instanceof PendingContentCollectible; }),
37
        ];
38
    }
39
}
40