Token   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 31
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __toString() 0 7 1
1
<?php
2
/**
3
 * The MIT License
4
 * Copyright (c) 2007 Andy Smith
5
 */
6
namespace Abraham\TwitterOAuth;
7
8
class Token
9
{
10
    /** @var string */
11
    public $key;
12
    /** @var string */
13
    public $secret;
14
15
    /**
16
     * @param string $key    The OAuth Token
17
     * @param string $secret The OAuth Token Secret
18
     */
19
    public function __construct($key, $secret)
20
    {
21
        $this->key = $key;
22
        $this->secret = $secret;
23
    }
24
25
    /**
26
     * Generates the basic string serialization of a token that a server
27
     * would respond to request_token and access_token calls with
28
     *
29
     * @return string
30
     */
31
    public function __toString()
32
    {
33
        return sprintf("oauth_token=%s&oauth_token_secret=%s",
34
            Util::urlencodeRfc3986($this->key),
35
            Util::urlencodeRfc3986($this->secret)
36
        );
37
    }
38
}
39