Completed
Pull Request — 1.11.x (#1599)
by José
28:19
created

AuthBearer   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A register() 0 3 1
A before_request() 0 3 1
1
<?php
2
namespace Culqi;
3
4
5
class AuthBearer implements \Requests_Auth
6
{
7
	protected $password;
8
9
	public function __construct($password) {
10
		$this->password = $password;
11
	}
12
13
	public function register(\Requests_Hooks &$hooks) {
14
		$hooks->register('requests.before_request', array(&$this, 'before_request'));
15
	}
16
17
	public function before_request(&$url, &$headers, &$data, &$type, &$options) {
18
		$headers['Authorization: Bearer'] = $this->password;
19
	}
20
}
21