Skip to content

Commit

Permalink
Changed up the structure of requests to allow for an object/array to …
Browse files Browse the repository at this point in the history
…be passed instead of lot of arguments/params
  • Loading branch information
aaronware committed Aug 19, 2015
1 parent 774dc07 commit 82d313f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Screenshots/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,17 @@ public function add_browser( $os, $os_version, $browser, $browser_version, $devi
* Short-hand function to build a request with a single browser/OS combination
*
* @param string $url
* @param string $os
* @param string $os_version
* @param string $browser
* @param string $browser_version
* @param \ArrayObject $browser
*
* @return Request
*/
public static function build_request( $url, $os, $os_version, $browser, $browser_version ) {
public static function build_request( $url, $browser = array() ) {
$request = new self;
$request->url = $url;
$request->add_browser( $os, $os_version, $browser, $browser_version );

if ( ! empty( $browser ) ) {
$request->add_browser( $browser['os'], $browser['os_version'], $browser['browser_name'], $browser['browser_version'] );
}

return $request;
}
Expand Down

0 comments on commit 82d313f

Please sign in to comment.