MediaBuilder   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A media() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DH\Adf\Builder;
6
7
use DH\Adf\Node\Child\Media;
8
9
trait MediaBuilder
10
{
11
    use BuilderInterface;
12
13
    public function media(string $id, string $mediaType, string $collection, ?int $width = null, ?int $height = null, ?string $occurrenceKey = null): Media
14
    {
15
        $block = new Media($id, $mediaType, $collection, $width, $height, $occurrenceKey, $this);
0 ignored issues
show
Bug introduced by
$this of type DH\Adf\Builder\MediaBuilder is incompatible with the type DH\Adf\Node\BlockNode|null expected by parameter $parent of DH\Adf\Node\Child\Media::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

15
        $block = new Media($id, $mediaType, $collection, $width, $height, $occurrenceKey, /** @scrutinizer ignore-type */ $this);
Loading history...
16
        $this->append($block);
17
18
        return $block;
19
    }
20
}
21