| Total Complexity | 4 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Coverage | 61.53% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class Token |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | protected $key; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | protected $secret; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @param string $key |
||
| 24 | * @param string $secret |
||
| 25 | */ |
||
| 26 | 34 | public function __construct($key, $secret) |
|
| 27 | { |
||
| 28 | 34 | $this->key = $key; |
|
| 29 | 34 | $this->secret = $secret; |
|
| 30 | 34 | } |
|
| 31 | |||
| 32 | /** |
||
| 33 | * Generates the basic string serialization of a token that a server |
||
| 34 | * would respond to request_token and access_token calls with |
||
| 35 | * |
||
| 36 | * @return string |
||
| 37 | */ |
||
| 38 | public function __toString() |
||
| 39 | { |
||
| 40 | return sprintf( |
||
| 41 | "oauth_token=%s&oauth_token_secret=%s", |
||
| 42 | Util::urldecodeRFC3986($this->key), |
||
| 43 | Util::urldecodeRFC3986($this->secret) |
||
| 44 | ); |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @return string |
||
| 49 | */ |
||
| 50 | 2 | public function getKey() |
|
| 51 | { |
||
| 52 | 2 | return $this->key; |
|
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @return string |
||
| 57 | */ |
||
| 58 | 6 | public function getSecret() |
|
| 61 | } |
||
| 62 | } |
||
| 63 |