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

AudioStream   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 22
ccs 4
cts 6
cp 0.6667
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getStreamMetadata() 0 3 1
A __construct() 0 4 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