1
|
|
|
<?php namespace FreedomCore\TrinityCore\Console\Commands; |
2
|
|
|
|
3
|
|
|
use FreedomCore\TrinityCore\Console\Abstracts\BaseCommand; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Class BNetAccount |
7
|
|
|
* @package FreedomCore\TrinityCore\Console\Commands |
8
|
|
|
* @codeCoverageIgnore |
9
|
|
|
*/ |
10
|
|
View Code Duplication |
class BNetAccount extends BaseCommand |
|
|
|
|
11
|
|
|
{ |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* Create new battle.net account |
15
|
|
|
* @param string $email |
16
|
|
|
* @param string $password |
17
|
|
|
* @return array|string |
18
|
|
|
*/ |
19
|
|
|
public function create(string $email, string $password) |
20
|
|
|
{ |
21
|
|
|
return $this->executeCommand(__FUNCTION__, get_defined_vars()); |
22
|
|
|
} |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* Create game account for specified battle.net account |
26
|
|
|
* @param string $email |
27
|
|
|
* @return array|string |
28
|
|
|
*/ |
29
|
|
|
public function gameAccountCreate(string $email) |
30
|
|
|
{ |
31
|
|
|
return $this->executeCommand(__FUNCTION__, get_defined_vars()); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* Link existing game account with battle.net account |
36
|
|
|
* @param string $email |
37
|
|
|
* @param string $login |
38
|
|
|
* @return array|string |
39
|
|
|
*/ |
40
|
|
|
public function link(string $email, string $login) |
41
|
|
|
{ |
42
|
|
|
return $this->executeCommand(__FUNCTION__, get_defined_vars()); |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* Unlink existing account from specified battle.net account |
47
|
|
|
* @param string $account |
48
|
|
|
* @param string $password |
49
|
|
|
* @return array|string |
50
|
|
|
*/ |
51
|
|
|
public function unlink(string $account, string $password) |
52
|
|
|
{ |
53
|
|
|
return $this->executeCommand(__FUNCTION__, get_defined_vars()); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* List game account on specified battle.net account |
58
|
|
|
* @param string $email |
59
|
|
|
* @return array|string |
60
|
|
|
*/ |
61
|
|
|
public function listGameAccounts(string $email) |
62
|
|
|
{ |
63
|
|
|
return $this->executeCommand(__FUNCTION__, get_defined_vars()); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* Set new password for specified battle.net account |
68
|
|
|
* @param string $email |
69
|
|
|
* @param string $password |
70
|
|
|
* @param string $repeatPassword |
71
|
|
|
* @return array|string |
72
|
|
|
*/ |
73
|
|
|
public function setPassword(string $email, string $password, string $repeatPassword) |
74
|
|
|
{ |
75
|
|
|
return $this->executeCommand(__FUNCTION__, get_defined_vars()); |
76
|
|
|
} |
77
|
|
|
} |
78
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.