Skip to content

Commit

Permalink
Apply fixes from StyleCI (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze authored Dec 28, 2016
1 parent 24f6667 commit d2b450f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/Spatie/Browsershot/Browsershot.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ class Browsershot
/** @var int */
protected $quality;

/** @var string */
/** @var string */
protected $backgroundColor;

/** @var string */
/** @var string */
protected $url;

/** @var string */
Expand Down Expand Up @@ -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');
}

Expand All @@ -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');
}

Expand All @@ -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');
}

Expand All @@ -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');
}

Expand Down Expand Up @@ -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');
}

Expand All @@ -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');
}

Expand All @@ -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');
}

Expand All @@ -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');
}

Expand Down

0 comments on commit d2b450f

Please sign in to comment.