Skip to content

Commit

Permalink
- fix phpdocs
Browse files Browse the repository at this point in the history
- added cookies reference to php.net
- PageRequest::$url is now protected - the value is mandatory and should be used in constructor
- removed guzzle
- updated documentation
  • Loading branch information
flaviu-chelaru committed Apr 30, 2017
1 parent 57de208 commit 7eb6493
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 278 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,14 @@
A library to interact with the Phantom JS Cloud

The library will generate the JSON Object. This object can be later sent as a HTTP Request with Guzzle or other HTTP Client for PHP.

The library does not make HTTP requests - this library only generates the JSON you can use as a payload when you make your HTTP requests.

### TODO - What we plan next for this code
* find a general way to generate the JSON with out the NULL arguments
* have a directory structure that will allow you to separate PhantomJS classes from helper classes
* migrate public arguments to protected arguments where possible and use setters and getters.
* integrate an HTTP client ( like GUZZLE HTTP )
* add unit testing
* see TODO's in the class comments
* add examples in the documentation
35 changes: 17 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
{
"name": "cfv1000/phantomjs-cloud",
"description": "PhantomJS Cloud API based on Guzzle",
"type": "library",
"require": {
"guzzlehttp/guzzle": "^6.2"
},
"authors": [
{
"name": "Flaviu Chelaru",
"email": "flaviu.chelaru@gmail.com"
}
],
"autoload": {
"psr-4": {
"PhantomJS\\" : "src/"
}
},
"minimum-stability": "stable"
"name": "cfv1000/phantomjs-cloud",
"description": "PhantomJS Cloud API based on Guzzle",
"type": "library",
"require": {
},
"authors": [
{
"name": "Flaviu Chelaru",
"email": "flaviu.chelaru@gmail.com"
}
],
"autoload": {
"psr-4": {
"PhantomJS\\": "src/"
}
},
"minimum-stability": "stable"
}
246 changes: 0 additions & 246 deletions composer.lock

This file was deleted.

2 changes: 2 additions & 0 deletions src/Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
/**
* Class Cookie
* @package PhantomJS
*
* @see http://php.net/manual/ro/function.setcookie.php
*/
class Cookie
{
Expand Down
4 changes: 2 additions & 2 deletions src/PageRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class PageRequest
* required. the target page you wish to load
* @var string
*/
public $url;
protected $url;

/**
* if specified, will be used as the content of the page you are loading (no network request will be made for the url).
Expand Down Expand Up @@ -74,7 +74,7 @@ class PageRequest
*
* @var string
*/
public $renderType;
public $renderType = self::RENDER_TYPE_JPEG;

/**
* adjustable parameters for when making network requests to the url specified
Expand Down
2 changes: 1 addition & 1 deletion src/PageResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class PageResponse
public $pageRequest;

/**
* @var any
* @var
*/
public $scriptOutput;

Expand Down
2 changes: 1 addition & 1 deletion src/PdfHeaderFooter.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class PdfHeaderFooter
{
/**
* if specified, this is used for the first page (instead of the repeating)
* @var stringw
* @var string
*/
public $firstPage;

Expand Down
3 changes: 2 additions & 1 deletion src/PdfOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ class PdfOptions
* Border is optional and defaults to 0.
* A non-uniform border can be specified in the form {left: '2cm', top: '2cm', right: '2cm', bottom: '3cm'}
* Use of px is strongly recommended.
* TODO Build an object to represent the data
*
* @var int|array
*/
public $border;
public $border = 0;

/**
* set the DPI for pdf generation.
Expand Down
4 changes: 3 additions & 1 deletion src/ProxyCustomOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ class ProxyCustomOptions
public $host;

/**
* type of the proxy server. default is http available types are http, socks5, and none
* type of the proxy server.
* default is http
* available types are http, socks5, and none
*
* @var string
*/
Expand Down
2 changes: 1 addition & 1 deletion src/RequestSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class RequestSettings
*
* @var int
*/
public $waitInterval;
public $waitInterval = 1000;

/**
* set to true to enable web security. default is false
Expand Down
Loading

0 comments on commit 7eb6493

Please sign in to comment.