Request::isPaginated()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4286
cc 3
eloc 3
nc 3
nop 0
1
<?php
2
/**
3
 * Request.php
4
 *
5
 * @copyright	More in license.md
6
 * @license		http://www.ipublikuj.eu
7
 * @author		Adam Kadlec http://www.ipublikuj.eu
8
 * @package		iPublikuj:500px!
9
 * @subpackage	Api
10
 * @since		5.0
11
 *
12
 * @date		07.03.15
13
 */
14
15
namespace IPub\FiveHundredPixel\Api;
16
17
use IPub;
18
use IPub\OAuth;
19
20
/**
21
 * Modify API call request parameters and add connection signature to the request
22
 *
23
 * @package		iPublikuj:500px!
24
 * @subpackage	Api
25
 *
26
 * @author Adam Kadlec <[email protected]>
27
 */
28
class Request extends OAuth\Api\Request
29
{
30
	/**
31
	 * {@inheritdoc}
32
	 */
33
	public function isPaginated()
34
	{
35
		$params = $this->getParameters();
36
37
		return $this->isGet() && (isset($params['per_page']) || isset($params['page']));
38
	}
39
40
	/**
41
	 * {@inheritdoc}
42
	 */
43
	public function getSignableParameters()
44
	{
45
		// Grab all parameters
46
		$params = array_merge($this->getParameters(), $this->post);
47
48
		// Remove oauth_signature if present
49
		// Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.")
50
		if (isset($params['oauth_signature'])) {
51
			unset($params['oauth_signature']);
52
		}
53
54
		return OAuth\Utils\Url::buildHttpQuery($params);
55
	}
56
}