| Conditions | 5 |
| Paths | 10 |
| Total Lines | 25 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 42 | public function actionIndex() |
||
| 43 | { |
||
| 44 | $user = User::findByPk($this->container->user->getID(), $this->container); |
||
|
|
|||
| 45 | if (!$user) { |
||
| 46 | $this->redirect('/logout'); |
||
| 47 | } |
||
| 48 | |||
| 49 | /** @var array $setup */ |
||
| 50 | if ($setup = $this->container->request->post('Setup')) { |
||
| 51 | if (!empty($setup['pass'])) { |
||
| 52 | $user->pass = md5($setup['pass']); |
||
| 53 | } |
||
| 54 | |||
| 55 | if (!empty($setup['fio'])) { |
||
| 56 | $user->fio = $setup['fio']; |
||
| 57 | } |
||
| 58 | |||
| 59 | $user->save(); |
||
| 60 | } |
||
| 61 | |||
| 62 | $v = new View($this->container); |
||
| 63 | $v->addParameter('user', $user); |
||
| 64 | |||
| 65 | return $v; |
||
| 66 | } |
||
| 67 | } |
||
| 68 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: