From 197b53435943367daba6be7dcd3a29512931e464 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Tue, 17 Dec 2013 17:39:24 +0100 Subject: [PATCH] Fix CS --- src/FFMpeg/FFMpegServiceProvider.php | 4 ++-- src/FFMpeg/FFProbe/DataMapping/AbstractData.php | 4 ++-- src/FFMpeg/Filters/Frame/FrameFilters.php | 4 ++-- src/FFMpeg/Filters/Video/RotateFilter.php | 1 - src/FFMpeg/Media/AbstractMediaType.php | 1 - src/FFMpeg/Media/Frame.php | 2 +- tests/FFMpeg/Functional/VideoTranscodeTest.php | 12 ++++++------ .../Filters/Frame/DisplayRatioFixerFilterTest.php | 4 ++-- tests/FFMpeg/Tests/Media/AudioTest.php | 1 - tests/FFMpeg/Tests/Media/VideoTest.php | 1 - 10 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/FFMpeg/FFMpegServiceProvider.php b/src/FFMpeg/FFMpegServiceProvider.php index 2d1419d..4bb489b 100644 --- a/src/FFMpeg/FFMpegServiceProvider.php +++ b/src/FFMpeg/FFMpegServiceProvider.php @@ -35,7 +35,7 @@ class FFMpegServiceProvider implements ServiceProviderInterface return array_replace($app['ffmpeg.default.configuration'], $app['ffmpeg.configuration']); }); - $app['ffmpeg'] = $app['ffmpeg.ffmpeg'] = $app->share(function(Application $app) { + $app['ffmpeg'] = $app['ffmpeg.ffmpeg'] = $app->share(function (Application $app) { $configuration = $app['ffmpeg.configuration.build']; if (isset($configuration['ffmpeg.timeout'])) { @@ -49,7 +49,7 @@ class FFMpegServiceProvider implements ServiceProviderInterface return new ArrayCache(); }); - $app['ffmpeg.ffprobe'] = $app->share(function(Application $app) { + $app['ffmpeg.ffprobe'] = $app->share(function (Application $app) { $configuration = $app['ffmpeg.configuration.build']; if (isset($configuration['ffmpeg.timeout'])) { diff --git a/src/FFMpeg/FFProbe/DataMapping/AbstractData.php b/src/FFMpeg/FFProbe/DataMapping/AbstractData.php index 63134b2..6fee9e2 100644 --- a/src/FFMpeg/FFProbe/DataMapping/AbstractData.php +++ b/src/FFMpeg/FFProbe/DataMapping/AbstractData.php @@ -53,8 +53,8 @@ abstract class AbstractData implements \Countable /** * Sets the property value given its name. * - * @param string $property - * @param mixed $value + * @param string $property + * @param mixed $value * * @return AbstractData */ diff --git a/src/FFMpeg/Filters/Frame/FrameFilters.php b/src/FFMpeg/Filters/Frame/FrameFilters.php index 255da0c..e4b9614 100644 --- a/src/FFMpeg/Filters/Frame/FrameFilters.php +++ b/src/FFMpeg/Filters/Frame/FrameFilters.php @@ -24,10 +24,10 @@ class FrameFilters /** * Fixes the display ratio of the output frame. - * + * * In case the sample ratio and display ratio are different, image may be * anamorphozed. This filter fixes this by specifying the output size. - * + * * @return FrameFilters */ public function fixDisplayRatio() diff --git a/src/FFMpeg/Filters/Video/RotateFilter.php b/src/FFMpeg/Filters/Video/RotateFilter.php index 5902a54..1ccfff5 100644 --- a/src/FFMpeg/Filters/Video/RotateFilter.php +++ b/src/FFMpeg/Filters/Video/RotateFilter.php @@ -13,7 +13,6 @@ namespace FFMpeg\Filters\Video; use FFMpeg\Coordinate\Dimension; use FFMpeg\Exception\InvalidArgumentException; -use FFMpeg\Exception\RuntimeException; use FFMpeg\Media\Video; use FFMpeg\Format\VideoInterface; diff --git a/src/FFMpeg/Media/AbstractMediaType.php b/src/FFMpeg/Media/AbstractMediaType.php index 879265b..45bb0c6 100644 --- a/src/FFMpeg/Media/AbstractMediaType.php +++ b/src/FFMpeg/Media/AbstractMediaType.php @@ -12,7 +12,6 @@ namespace FFMpeg\Media; use FFMpeg\Driver\FFMpegDriver; -use FFMpeg\Exception\InvalidArgumentException; use FFMpeg\FFProbe; use FFMpeg\Filters\FiltersCollection; use FFMpeg\Media\MediaTypeInterface; diff --git a/src/FFMpeg/Media/Frame.php b/src/FFMpeg/Media/Frame.php index a48c50e..b50e549 100644 --- a/src/FFMpeg/Media/Frame.php +++ b/src/FFMpeg/Media/Frame.php @@ -110,7 +110,7 @@ class Frame extends AbstractMediaType foreach ($this->filters as $filter) { $commands = array_merge($commands, $filter->apply($this)); } - + $commands = array_merge($commands, array($pathfile)); try { diff --git a/tests/FFMpeg/Functional/VideoTranscodeTest.php b/tests/FFMpeg/Functional/VideoTranscodeTest.php index 6dde247..9e690bf 100644 --- a/tests/FFMpeg/Functional/VideoTranscodeTest.php +++ b/tests/FFMpeg/Functional/VideoTranscodeTest.php @@ -9,7 +9,7 @@ use FFMpeg\Format\Video\X264; use FFMpeg\Media\Video; class VideoTranscodeTest extends FunctionalTestCase -{ +{ public function testSimpleTranscodeX264() { $filename = __DIR__ . '/output/output-x264.mp4'; @@ -65,7 +65,7 @@ class VideoTranscodeTest extends FunctionalTestCase if ($info['name'] === 'avconv' && version_compare($info['version'], '0.9', '<')) { $this->markTestSkipped('This version of avconv is buggy and does not support this test.'); } - + $filename = __DIR__ . '/output/output-x264.mp4'; if (is_file($filename)) { unlink(__DIR__ . '/output/output-x264.mp4'); @@ -91,7 +91,7 @@ class VideoTranscodeTest extends FunctionalTestCase $this->assertFileExists($filename); unlink($filename); } - + private function getNameAndVersion() { $binary = $this @@ -99,20 +99,20 @@ class VideoTranscodeTest extends FunctionalTestCase ->getFFMpegDriver() ->getProcessBuilderFactory() ->getBinary(); - + $output = $matches = null; exec($binary . ' -version 2>&1', $output); if (!isset($output[0])) { return array('name' => null, 'version' => null); } - + preg_match('/^([a-z]+)\s+version\s+([0-9\.]+)/i', $output[0], $matches); if (count($matches) > 0) { return array('name' => $matches[1], 'version' => $matches[2]); } - + return array('name' => null, 'version' => null); } } diff --git a/tests/FFMpeg/Tests/Filters/Frame/DisplayRatioFixerFilterTest.php b/tests/FFMpeg/Tests/Filters/Frame/DisplayRatioFixerFilterTest.php index bb642b4..ca8035f 100644 --- a/tests/FFMpeg/Tests/Filters/Frame/DisplayRatioFixerFilterTest.php +++ b/tests/FFMpeg/Tests/Filters/Frame/DisplayRatioFixerFilterTest.php @@ -15,12 +15,12 @@ class DisplayRatioFixerFilterTest extends TestCase { $stream = new Stream(array('codec_type' => 'video', 'width' => 960, 'height' => 720)); $streams = new StreamCollection(array($stream)); - + $video = $this->getVideoMock(__FILE__); $video->expects($this->once()) ->method('getStreams') ->will($this->returnValue($streams)); - + $frame = new Frame($video, $this->getFFMpegDriverMock(), $this->getFFProbeMock(), new TimeCode(0, 0, 0, 0)); $filter = new DisplayRatioFixerFilter(); $this->assertEquals(array('-s', '960x720'), $filter->apply($frame)); diff --git a/tests/FFMpeg/Tests/Media/AudioTest.php b/tests/FFMpeg/Tests/Media/AudioTest.php index 2f37942..bca3967 100644 --- a/tests/FFMpeg/Tests/Media/AudioTest.php +++ b/tests/FFMpeg/Tests/Media/AudioTest.php @@ -4,7 +4,6 @@ namespace FFMpeg\Tests\Media; use FFMpeg\Media\Audio; use Alchemy\BinaryDriver\Exception\ExecutionFailureException; -use FFMpeg\Format\ProgressableInterface; use FFMpeg\Format\AudioInterface; class AudioTest extends AbstractStreamableTestCase diff --git a/tests/FFMpeg/Tests/Media/VideoTest.php b/tests/FFMpeg/Tests/Media/VideoTest.php index 9f5e84c..fa74adb 100644 --- a/tests/FFMpeg/Tests/Media/VideoTest.php +++ b/tests/FFMpeg/Tests/Media/VideoTest.php @@ -4,7 +4,6 @@ namespace FFMpeg\Tests\Media; use FFMpeg\Media\Video; use Alchemy\BinaryDriver\Exception\ExecutionFailureException; -use FFMpeg\Format\ProgressableInterface; use FFMpeg\Format\VideoInterface; class VideoTest extends AbstractStreamableTestCase