Request::isPaginated()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 2
eloc 3
nc 2
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:Twitter!
9
 * @subpackage	Api
10
 * @since		5.0
11
 *
12
 * @date		05.03.15
13
 */
14
15
namespace IPub\Twitter\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:Twitter!
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['count']);
38
	}
39
40
	/**
41
	 * {@inheritdoc}
42
	 */
43
	public function getSignableParameters()
44
	{
45
		// Grab all parameters
46
		$params = $this->getParameters();
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
}