Failed Conditions
Push — master ( df4f19...50f2bb )
by Sébastien
02:46 queued 13s
created

src/Video/DetectionService.php (1 issue)

1
<?php
2
3
declare(strict_types=1);
4
5
namespace Soluble\MediaTools\Video;
6
7
use Soluble\MediaTools\Config\FFMpegConfig;
8
use Soluble\MediaTools\Exception\FileNotFoundException;
9
use Soluble\MediaTools\Video\Detection\InterlaceDetect;
10
use Soluble\MediaTools\Video\Detection\InterlaceGuess;
11
use Symfony\Component\Process\Exception\RuntimeException as SPRuntimeException;
12
13
class DetectionService implements DetectionServiceInterface
14
{
15
    /** @var FFMpegConfig */
16
    protected $ffmpegConfig;
17
18 1
    public function __construct(FFMpegConfig $ffmpegConfig)
19
    {
20 1
        $this->ffmpegConfig  = $ffmpegConfig;
0 ignored issues
show
Equals sign not aligned correctly; expected 1 space but found 2 spaces

This check looks for improperly formatted assignments.

Every assignment must have exactly one space before and one space after the equals operator.

To illustrate:

$a = "a";
$ab = "ab";
$abc = "abc";

will have no issues, while

$a   = "a";
$ab  = "ab";
$abc = "abc";

will report issues in lines 1 and 2.

Loading history...
21 1
    }
22
23
    /**
24
     * @param int $maxFramesToAnalyze interlacement detection can be heavy, limit the number of frames to analyze
25
     *
26
     * @throws SPRuntimeException
27
     * @throws FileNotFoundException
28
     */
29 1
    public function detectInterlacement(string $file, int $maxFramesToAnalyze = InterlaceDetect::DEFAULT_INTERLACE_MAX_FRAMES): InterlaceGuess
30
    {
31 1
        $interlaceDetect = new InterlaceDetect($this->ffmpegConfig);
32
33 1
        return $interlaceDetect->guessInterlacing($file, $maxFramesToAnalyze);
34
    }
35
}
36