@@ -1,53 +1,53 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | class CreateUser extends AbstractRequest { |
4 | - /** |
|
5 | - * @var Location |
|
6 | - */ |
|
7 | - private $location; |
|
8 | - private $deviceUid; |
|
9 | - /** |
|
10 | - * @return Location |
|
11 | - */ |
|
12 | - private function getLocation() |
|
13 | - { |
|
14 | - return $this->location; |
|
15 | - } |
|
16 | - /** |
|
17 | - * @param Location $location |
|
18 | - */ |
|
19 | - public function setLocation(Location $location) |
|
20 | - { |
|
21 | - $this->location = $location; |
|
22 | - } |
|
23 | - private function getDeviceUid() |
|
24 | - { |
|
4 | + /** |
|
5 | + * @var Location |
|
6 | + */ |
|
7 | + private $location; |
|
8 | + private $deviceUid; |
|
9 | + /** |
|
10 | + * @return Location |
|
11 | + */ |
|
12 | + private function getLocation() |
|
13 | + { |
|
14 | + return $this->location; |
|
15 | + } |
|
16 | + /** |
|
17 | + * @param Location $location |
|
18 | + */ |
|
19 | + public function setLocation(Location $location) |
|
20 | + { |
|
21 | + $this->location = $location; |
|
22 | + } |
|
23 | + private function getDeviceUid() |
|
24 | + { |
|
25 | 25 | return $this->deviceUid; |
26 | 26 | } |
27 | 27 | public function setDeviceUid($deviceUid) |
28 | - { |
|
28 | + { |
|
29 | 29 | $this->deviceUid = $deviceUid; |
30 | 30 | } |
31 | - private function generateDeviceUid() |
|
32 | - { |
|
33 | - return $this->random_str(64, 'abcdef0123456789'); |
|
34 | - } |
|
31 | + private function generateDeviceUid() |
|
32 | + { |
|
33 | + return $this->random_str(64, 'abcdef0123456789'); |
|
34 | + } |
|
35 | 35 | |
36 | - private function random_str($length, $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') |
|
37 | - { |
|
38 | - $str = ''; |
|
39 | - $max = mb_strlen($keyspace, '8bit') - 1; |
|
40 | - for ($i = 0; $i < $length; ++$i) { |
|
41 | - $str .= $keyspace[rand(0, $max)]; |
|
42 | - } |
|
43 | - return $str; |
|
44 | - } |
|
45 | - public function getApiEndPoint() |
|
46 | - { |
|
47 | - return '/v2/users'; |
|
48 | - } |
|
49 | - public function getPayload() |
|
50 | - { |
|
36 | + private function random_str($length, $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') |
|
37 | + { |
|
38 | + $str = ''; |
|
39 | + $max = mb_strlen($keyspace, '8bit') - 1; |
|
40 | + for ($i = 0; $i < $length; ++$i) { |
|
41 | + $str .= $keyspace[rand(0, $max)]; |
|
42 | + } |
|
43 | + return $str; |
|
44 | + } |
|
45 | + public function getApiEndPoint() |
|
46 | + { |
|
47 | + return '/v2/users'; |
|
48 | + } |
|
49 | + public function getPayload() |
|
50 | + { |
|
51 | 51 | if(!isset($this->deviceUid)) |
52 | 52 | { |
53 | 53 | $this->setDeviceUid($this->generateDeviceUid()); |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | "client_id" => self::CLIENTID, |
59 | 59 | "device_uid" => $this->getDeviceUid(), |
60 | 60 | ); |
61 | - } |
|
62 | - public function getMethod() |
|
63 | - { |
|
64 | - return 'POST'; |
|
65 | - } |
|
61 | + } |
|
62 | + public function getMethod() |
|
63 | + { |
|
64 | + return 'POST'; |
|
65 | + } |
|
66 | 66 | } |