Account   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 3
Bugs 0 Features 2
Metric Value
wmc 2
c 3
b 0
f 2
lcom 1
cbo 3
dl 0
loc 28
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getAccountId() 0 5 1
A getBattleTag() 0 5 1
1
<?php
2
namespace Jleagle\BattleNet;
3
4
use Jleagle\BattleNet\Request\AbstractBattleNetAuth;
5
use Jleagle\BattleNet\Responses\Account\BattleTagResponse;
6
use Jleagle\BattleNet\Responses\Account\UserResponse;
7
8
class Account extends AbstractBattleNetAuth
9
{
10
  private $_path = 'account';
11
12
  /**
13
   * @param string $accessToken
14
   *
15
   * @return UserResponse
16
   * @throws Exceptions\BattleNetException
17
   */
18
  public function getAccountId($accessToken)
19
  {
20
    $data = $this->_get($this->_path . '/user/id', $accessToken);
21
    return new UserResponse($data);
22
  }
23
24
  /**
25
   * @param string $accessToken
26
   *
27
   * @return BattleTagResponse
28
   * @throws Exceptions\BattleNetException
29
   */
30
  public function getBattleTag($accessToken)
31
  {
32
    $data = $this->_get($this->_path . '/user/battletag', $accessToken);
33
    return new BattleTagResponse($data);
34
  }
35
}
36