Skip to content

Commit

Permalink
prepare 1.4 release
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Nov 23, 2015
1 parent f7a5704 commit 77c0a35
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@

All Notable changes to `browsershot` will be documented in this file

##1.4.0
- Added timeout parameter

##1.3.0
- Added quality parameter
35 changes: 14 additions & 21 deletions src/Spatie/Browsershot/Browsershot.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,59 +11,52 @@
class Browsershot
{
/**
* @var int Required Browsershot width
* @var int
*/
private $width;

/**
* @var int Required Browsershot height
* @var int
*/
protected $height;

/**
* @var int Required Browsershot image quality
* @var int
*/
protected $quality;

/**
* @var int URL to Browsershot
* @var int
*/
protected $url;

/**
* @var string Path to the phantomjs binary
* @var string
*/
protected $binPath;

/**
* @var int Required Browsershot page timeout
* @var int
*/
protected $timeout;

/**
* @param string $binPath The path to the phantomjs binary
* @param int $width The required Browsershot width
* @param int $height The required Browsershot height
* @param int $quality The required Browsershot image quality
* @param int $timeout The required Browsershot page timeout
*/
public function __construct($binPath = '', $width = 640, $height = 480, $quality = 60, $timeout=5000)
public function __construct($binPath = '', $width = 640, $height = 480, $quality = 60, $timeout = 5000)
{
if ($binPath == '') {
$binPath = realpath(dirname(__FILE__).'/../../../bin/phantomjs');
}

$this->binPath = $binPath;
$this->width = $width;
$this->height = $height;
$this->width = $width;
$this->height = $height;
$this->quality = $quality;
$this->timeout = $timeout;

return $this;
}

/**
* @param string $binPath The path to the phantomjs binary
* @param string $binPath
*
* @return $this
*/
Expand All @@ -75,7 +68,7 @@ public function setBinPath($binPath)
}

/**
* @param int $width The required with of the screenshot
* @param int $width
*
* @return $this
*
Expand All @@ -93,7 +86,7 @@ public function setWidth($width)
}

/**
* @param int $height The required height of the screenshot
* @param int $height
*
* @return $this
*
Expand Down Expand Up @@ -143,7 +136,7 @@ public function setHeightToRenderWholePage()
}

/**
* @param string $url The website of which a screenshot should be made.
* @param string $url
*
* @return $this
*
Expand All @@ -161,7 +154,7 @@ public function setUrl($url)
}

/**
* @param int $timeout The required Browsershot page timeout
* @param int $timeout
*
* @return $this
*
Expand Down

0 comments on commit 77c0a35

Please sign in to comment.