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() |
||
56 | |||
57 | |||
58 | /** |
||
59 | * Associates the user to the group by their given IDs |
||
60 | * |
||
61 | * @param \Aimeos\MShop\Context\Item\Iface $context Aimeos context object |
||
62 | * @param string $userid Unique user ID |
||
63 | * @param string $groupid Unique group ID |
||
64 | */ |
||
65 | protected function addListItem( \Aimeos\MShop\Context\Item\Iface $context, $userid, $groupid ) |
||
92 | |||
93 | |||
94 | /** |
||
95 | * Adds the privilege to the given user |
||
96 | * |
||
97 | * @param \Aimeos\MShop\Context\Item\Iface $context Aimeos context object |
||
98 | * @param \Aimeos\MShop\Customer\Item\Iface $user Aimeos customer object |
||
99 | * @param string $privilege Unique customer group code |
||
100 | */ |
||
101 | protected function addPrivilege( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MShop\Customer\Item\Iface $user, $privilege ) |
||
120 | |||
121 | |||
122 | /** |
||
123 | * Get the console command arguments. |
||
124 | * |
||
125 | * @return array |
||
126 | */ |
||
127 | protected function getArguments() |
||
134 | |||
135 | |||
136 | /** |
||
137 | * Returns the customer item for the given e-mail and set its password |
||
138 | * |
||
139 | * If the customer doesn't exist yet, it will be created. |
||
140 | * |
||
141 | * @param \Aimeos\MShop\Context\Item\Iface $context Aimeos context object |
||
142 | * @param string $email Unique e-mail address |
||
143 | * @param string $password New user password |
||
144 | * @return \Aimeos\MShop\Customer\Item\Iface Aimeos customer item object |
||
145 | */ |
||
146 | protected function getCustomerItem( \Aimeos\MShop\Context\Item\Iface $context, $email, $password ) |
||
164 | |||
165 | |||
166 | /** |
||
167 | * Returns the customer group item for the given code |
||
168 | * |
||
169 | * @param \Aimeos\MShop\Context\Item\Iface $context Aimeos context object |
||
170 | * @param string $code Unique customer group code |
||
171 | * @return \Aimeos\MShop\Customer\Item\Group\Iface Aimeos customer group item object |
||
172 | */ |
||
173 | protected function getGroupItem( \Aimeos\MShop\Context\Item\Iface $context, $code ) |
||
192 | |||
193 | |||
194 | /** |
||
195 | * Get the console command options. |
||
196 | * |
||
197 | * @return array |
||
198 | */ |
||
199 | protected function getOptions() |
||
206 | |||
207 | |||
208 | /** |
||
209 | * Returns the customer group type item for the given code |
||
210 | * |
||
211 | * @param \Aimeos\MShop\Common\Manager\Iface $listManager Aimeos customer list manager object |
||
212 | * @param string $code Unique code for a customer list type |
||
213 | * @return \Aimeos\MShop\Common\Item\Type\Iface Aimeos customer list type item object |
||
214 | * @throws \Exception If no customer list type item for the given code is found |
||
215 | */ |
||
216 | protected function getTypeItem( \Aimeos\MShop\Common\Manager\Iface $listManager, $code ) |
||
237 | } |
||
238 |
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.