From d2b450f3c1e9cd37b724f69bfcb103c4bd4dc678 Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Wed, 28 Dec 2016 19:25:29 +0100 Subject: [PATCH] Apply fixes from StyleCI (#33) --- src/Spatie/Browsershot/Browsershot.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Spatie/Browsershot/Browsershot.php b/src/Spatie/Browsershot/Browsershot.php index c6da08a8..63cdad8b 100644 --- a/src/Spatie/Browsershot/Browsershot.php +++ b/src/Spatie/Browsershot/Browsershot.php @@ -16,10 +16,10 @@ class Browsershot /** @var int */ protected $quality; - /** @var string */ + /** @var string */ protected $backgroundColor; - /** @var string */ + /** @var string */ protected $url; /** @var string */ @@ -65,7 +65,7 @@ public function setBinPath($binPath) */ public function setWidth($width) { - if (!is_numeric($width)) { + if (! is_numeric($width)) { throw new Exception('Width must be numeric'); } @@ -83,7 +83,7 @@ public function setWidth($width) */ public function setHeight($height) { - if (!is_numeric($height)) { + if (! is_numeric($height)) { throw new Exception('Height must be numeric'); } @@ -103,7 +103,7 @@ public function setHeight($height) */ public function setQuality($quality) { - if (!is_numeric($quality) || $quality < 1 || $quality > 100) { + if (! is_numeric($quality) || $quality < 1 || $quality > 100) { throw new Exception('Quality must be a numeric value between 1 - 100'); } @@ -123,7 +123,7 @@ public function setQuality($quality) */ public function setBackgroundColor($backgroundColor) { - if (!strlen($backgroundColor) > 0) { + if (! strlen($backgroundColor) > 0) { throw new Exception('No background color specified'); } @@ -153,7 +153,7 @@ public function setHeightToRenderWholePage() */ public function setUrl($url) { - if (!strlen($url) > 0) { + if (! strlen($url) > 0) { throw new Exception('No url specified'); } @@ -171,7 +171,7 @@ public function setUrl($url) */ public function setTimeout($timeout) { - if (!is_numeric($timeout)) { + if (! is_numeric($timeout)) { throw new Exception('Height must be numeric'); } @@ -195,7 +195,7 @@ public function save($targetFile) throw new Exception('targetfile not set'); } - if (!in_array(strtolower(pathinfo($targetFile, PATHINFO_EXTENSION)), ['jpeg', 'jpg', 'png'])) { + if (! in_array(strtolower(pathinfo($targetFile, PATHINFO_EXTENSION)), ['jpeg', 'jpg', 'png'])) { throw new Exception('targetfile extension not valid'); } @@ -207,13 +207,13 @@ public function save($targetFile) throw new Exception('url is invalid'); } - if (!file_exists($this->binPath)) { + if (! file_exists($this->binPath)) { throw new Exception('binary does not exist'); } $this->takeScreenShot($targetFile); - if (!file_exists($targetFile) || filesize($targetFile) < 1024) { + if (! file_exists($targetFile) || filesize($targetFile) < 1024) { throw new Exception('could not create screenshot'); }