Passed
Push — master ( 4eae52...59c295 )
by Sébastien
03:55
created

AudioStream::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Soluble\MediaTools\Video\Info;
6
7
use Psr\Log\LoggerInterface;
8
use Soluble\MediaTools\Video\Info\Util\MetadataTypeSafeReader;
9
10
class AudioStream implements AudioStreamInterface
11
{
12
    /** @var array<string, mixed> */
13
    private $streamMetadata;
14
15
    /** @var MetadataTypeSafeReader */
16
    private $tsReader;
17
18 1
    public function __construct(array $streamMetadata, ?LoggerInterface $logger = null)
19
    {
20 1
        $this->streamMetadata = $streamMetadata;
21 1
        $this->tsReader       = new MetadataTypeSafeReader($streamMetadata, $logger);
22 1
    }
23
24
    /**
25
     * Return underlying ffprobe json metadata.
26
     *
27
     * @return array<string, mixed>
28
     */
29
    public function getStreamMetadata(): array
30
    {
31
        return $this->streamMetadata;
32
    }
33
}
34