1 | <?php |
||
18 | class AccountCommand extends AbstractCommand |
||
19 | { |
||
20 | /** |
||
21 | * The console command name. |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $name = 'aimeos:account'; |
||
26 | |||
27 | /** |
||
28 | * The console command description. |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $description = 'Creates new (admin) accounts'; |
||
33 | |||
34 | |||
35 | /** |
||
36 | * Execute the console command. |
||
37 | * |
||
38 | * @return mixed |
||
39 | */ |
||
40 | public function fire() |
||
59 | |||
60 | |||
61 | /** |
||
62 | * Associates the user to the group by their given IDs |
||
63 | * |
||
64 | * @param \Aimeos\MShop\Context\Item\Iface $context Aimeos context object |
||
65 | * @param string $userid Unique user ID |
||
66 | * @param string $groupid Unique group ID |
||
67 | */ |
||
68 | protected function addListItem( \Aimeos\MShop\Context\Item\Iface $context, $userid, $groupid ) |
||
95 | |||
96 | |||
97 | /** |
||
98 | * Adds the privilege to the given user |
||
99 | * |
||
100 | * @param \Aimeos\MShop\Context\Item\Iface $context Aimeos context object |
||
101 | * @param \Aimeos\MShop\Customer\Item\Iface $user Aimeos customer object |
||
102 | * @param string $privilege Unique customer group code |
||
103 | */ |
||
104 | protected function addPrivilege( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MShop\Customer\Item\Iface $user, $privilege ) |
||
123 | |||
124 | |||
125 | /** |
||
126 | * Returns the customer item for the given e-mail and set its password |
||
127 | * |
||
128 | * If the customer doesn't exist yet, it will be created. |
||
129 | * |
||
130 | * @param \Aimeos\MShop\Context\Item\Iface $context Aimeos context object |
||
131 | * @param string $email Unique e-mail address |
||
132 | * @param string $password New user password |
||
133 | * @return \Aimeos\MShop\Customer\Item\Iface Aimeos customer item object |
||
134 | */ |
||
135 | protected function createCustomerItem( \Aimeos\MShop\Context\Item\Iface $context, $email, $password ) |
||
153 | |||
154 | |||
155 | /** |
||
156 | * Get the console command arguments. |
||
157 | * |
||
158 | * @return array |
||
159 | */ |
||
160 | protected function getArguments() |
||
167 | |||
168 | |||
169 | /** |
||
170 | * Returns the customer group item for the given code |
||
171 | * |
||
172 | * @param \Aimeos\MShop\Context\Item\Iface $context Aimeos context object |
||
173 | * @param string $code Unique customer group code |
||
174 | * @return \Aimeos\MShop\Customer\Item\Group\Iface Aimeos customer group item object |
||
175 | */ |
||
176 | protected function getGroupItem( \Aimeos\MShop\Context\Item\Iface $context, $code ) |
||
195 | |||
196 | |||
197 | /** |
||
198 | * Get the console command options. |
||
199 | * |
||
200 | * @return array |
||
201 | */ |
||
202 | protected function getOptions() |
||
209 | |||
210 | |||
211 | /** |
||
212 | * Returns the customer group type item for the given code |
||
213 | * |
||
214 | * @param \Aimeos\MShop\Common\Manager\Iface $listManager Aimeos customer list manager object |
||
215 | * @param string $code Unique code for a customer list type |
||
216 | * @return \Aimeos\MShop\Common\Item\Type\Iface Aimeos customer list type item object |
||
217 | * @throws \Exception If no customer list type item for the given code is found |
||
218 | */ |
||
219 | protected function getTypeItem( \Aimeos\MShop\Common\Manager\Iface $listManager, $code ) |
||
240 | } |
||
241 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.