From f6def020c1d1225b3660a2adc7ed2c6e12a38b7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B3th=20G=C3=A1bor?= Date: Tue, 4 Jun 2013 18:23:45 +0200 Subject: [PATCH] minor exception message cleanup --- src/FFMpeg/Binary.php | 2 +- src/FFMpeg/FFMpeg.php | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/FFMpeg/Binary.php b/src/FFMpeg/Binary.php index 36fe496..0ede05f 100644 --- a/src/FFMpeg/Binary.php +++ b/src/FFMpeg/Binary.php @@ -74,7 +74,7 @@ abstract class Binary implements AdapterInterface public function setTimeout($timeout) { if (0 > $timeout) { - throw new InvalidArgumentException('Timeout must be a positive value'); + throw new InvalidArgumentException('Timeout must be a non-negative value'); } $this->timeout = $timeout; diff --git a/src/FFMpeg/FFMpeg.php b/src/FFMpeg/FFMpeg.php index 0d7a604..cc50d7e 100644 --- a/src/FFMpeg/FFMpeg.php +++ b/src/FFMpeg/FFMpeg.php @@ -101,7 +101,7 @@ class FFMpeg extends Binary if (!file_exists($pathfile)) { $this->logger->addError(sprintf('FFmpeg failed to open %s', $pathfile)); - throw new InvalidArgumentException(sprintf('File %s does not exists', $pathfile)); + throw new InvalidArgumentException(sprintf('File %s does not exist', $pathfile)); } $this->logger->addInfo(sprintf('FFmpeg opens %s', $pathfile)); @@ -181,7 +181,6 @@ class FFMpeg extends Binary $process = $builder->getProcess(); $process->setTimeout($this->timeout); - $this->logger->addInfo(sprintf('FFmpeg executes command %s', $process->getCommandline())); try { @@ -191,7 +190,7 @@ class FFMpeg extends Binary } if (!$process->isSuccessful()) { - $this->logger->addError(sprintf('FFmpeg command failed : %s', $process->getErrorOutput())); + $this->logger->addError(sprintf('FFmpeg command failed: %s', $process->getErrorOutput())); $this->cleanupTemporaryFile($output); @@ -277,7 +276,7 @@ class FFMpeg extends Binary if (!$process->isSuccessful()) { $this->logger->addInfo(sprintf('FFmpeg command failed')); - throw new RuntimeException(sprintf('Encoding failed : %s', $process->getErrorOutput())); + throw new RuntimeException(sprintf('Encoding failed: %s', $process->getErrorOutput())); } $this->logger->addInfo(sprintf('FFmpeg command successful')); @@ -327,9 +326,9 @@ class FFMpeg extends Binary } if ($originalHeight !== null && $originalWidth !== null) { - $this->logger->addInfo(sprintf('Read dimension for resizin succesful : %s x %s', $originalWidth, $originalHeight)); + $this->logger->addInfo(sprintf('Read dimension for resizing succesful : %s x %s', $originalWidth, $originalHeight)); } else { - $this->logger->addInfo(sprintf('Read dimension for resizin failed !')); + $this->logger->addInfo(sprintf('Read dimension for resizing failed !')); } if ($originalHeight !== null && $originalWidth !== null) {