-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathCoreEndpoint.php
More file actions
35 lines (27 loc) · 844 Bytes
/
CoreEndpoint.php
File metadata and controls
35 lines (27 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
namespace GW2Treasures\GW2Api\V2\Endpoint\Character;
use GW2Treasures\GW2Api\GW2Api;
use GW2Treasures\GW2Api\V2\Authentication\AuthenticatedEndpoint;
use GW2Treasures\GW2Api\V2\Authentication\IAuthenticatedEndpoint;
use GW2Treasures\GW2Api\V2\Endpoint;
class CoreEndpoint extends Endpoint implements IAuthenticatedEndpoint {
use AuthenticatedEndpoint;
protected $character;
public function __construct( GW2Api $api, $apiKey, $character ) {
parent::__construct( $api );
$this->apiKey = $apiKey;
$this->character = $character;
}
/**
* {@inheritdoc}
*/
public function url() {
return 'v2/characters/' . rawurlencode( $this->character ) . '/core';
}
/**
* @return mixed
*/
public function get() {
return $this->request()->json();
}
}