| Conditions | 4 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function actionUpdateUsername($usernames) |
||
| 25 | { |
||
| 26 | $rows = StringHelper::explode($usernames, ';', true, true); |
||
| 27 | foreach ($rows as $row) { |
||
| 28 | $username = StringHelper::explode($row, ',', true, true); |
||
| 29 | $account = Account::findOne(['username' => $username['0']]); |
||
| 30 | if ($account) { |
||
| 31 | $account->username = $username['1']; |
||
| 32 | if (!$account->update()) { |
||
|
|
|||
| 33 | echo Console::errorSummary($account); |
||
| 34 | |||
| 35 | return ExitCode::DATAERR; |
||
| 36 | } |
||
| 41 | } |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
integervalues, zero is a special case, in particular the following results might be unexpected: