EmbedParser   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 40
ccs 15
cts 15
cp 1
rs 10
c 1
b 0
f 0
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getBlock() 0 3 1
A canHaveLazyContinuationLines() 0 3 1
A closeBlock() 0 2 1
A tryContinue() 0 3 1
A canContain() 0 3 1
A isContainer() 0 3 1
A addLine() 0 2 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the league/commonmark package.
7
 *
8
 * (c) Colin O'Dell <[email protected]>
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 League\CommonMark\Extension\Embed;
15
16
use League\CommonMark\Node\Block\AbstractBlock;
17
use League\CommonMark\Parser\Block\BlockContinue;
18
use League\CommonMark\Parser\Block\BlockContinueParserInterface;
19
use League\CommonMark\Parser\Cursor;
20
21
class EmbedParser implements BlockContinueParserInterface
22
{
23
    private Embed $embed;
24
25 14
    public function __construct(string $url)
26
    {
27 14
        $this->embed = new Embed($url);
28
    }
29
30 14
    public function getBlock(): AbstractBlock
31
    {
32 14
        return $this->embed;
33
    }
34
35 14
    public function isContainer(): bool
36
    {
37 14
        return false;
38
    }
39
40 6
    public function canHaveLazyContinuationLines(): bool
41
    {
42 6
        return false;
43
    }
44
45 2
    public function canContain(AbstractBlock $childBlock): bool
46
    {
47 2
        return false;
48
    }
49
50 10
    public function tryContinue(Cursor $cursor, BlockContinueParserInterface $activeBlockParser): ?BlockContinue
51
    {
52 10
        return BlockContinue::none();
53
    }
54
55 12
    public function addLine(string $line): void
56
    {
57 12
    }
58
59 12
    public function closeBlock(): void
60
    {
61 12
    }
62
}
63