Request   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 5
c 4
b 0
f 0
lcom 1
cbo 2
dl 0
loc 29
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isPaginated() 0 6 3
A getSignableParameters() 0 13 2
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:Flickr!
9
 * @subpackage	Api
10
 * @since		5.0
11
 *
12
 * @date		05.03.15
13
 */
14
15
namespace IPub\Flickr\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:Flickr!
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
}