for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Toa\Component\Validator\Provider;
use FFMpeg\FFMpeg;
use Toa\Component\Validator\Exception\NotFoundDataException;
/**
* FFMpegProvider
*
* @author Enrico Thies <[email protected]>
*/
class FFMpegProvider implements VideoProviderInterface
{
/** @var FFMpeg\FFMpeg */
private $ffmpeg;
/** @var FFMpeg\FFProbe\DataMapping\Stream[] */
private $streams = array();
* @param FFMpeg $ffmpeg
public function __construct(FFMpeg $ffmpeg)
$this->ffmpeg = $ffmpeg;
$ffmpeg
object<FFMpeg\FFMpeg>
object<FFMpeg\FFMpeg\FFMpeg>
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
}
* @param string $pathfile
* @return \FFMpeg\FFProbe\DataMapping\Stream
protected function getStream($pathfile)
if (!isset($this->streams[$pathfile])) {
try {
$this->streams[$pathfile] = $this->ffmpeg->open($pathfile)->getStreams()->first();
} catch (\RuntimeException $e) {
throw new NotFoundDataException(
sprintf('Unable to provide data for "%s"', $pathfile),
$e->getCode(),
$e
);
return $this->streams[$pathfile];
* {@inheritdoc}
public function getDuration($value)
return $this->getStream($value)->get('duration');
public function getHeight($value)
return $this->getStream($value)->get('height');
public function getWidth($value)
return $this->getStream($value)->get('width');
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..