@@ -25,11 +25,13 @@ discard block |
||
| 25 | 25 | $load_stmt->setFetchMode(\PDO::FETCH_INTO, $user); |
| 26 | 26 | $load_stmt->bindParam(1, $email); |
| 27 | 27 | |
| 28 | - if (!$load_stmt->execute()) |
|
| 29 | - throw new \Exception(sprintf('Email "%s" does not exist.', $email)); |
|
| 28 | + if (!$load_stmt->execute()) { |
|
| 29 | + throw new \Exception(sprintf('Email "%s" does not exist.', $email)); |
|
| 30 | + } |
|
| 30 | 31 | |
| 31 | - if (!$load_stmt->fetch()) |
|
| 32 | - throw new \Exception(sprintf('Email "%s" does not exist.', $email)); |
|
| 32 | + if (!$load_stmt->fetch()) { |
|
| 33 | + throw new \Exception(sprintf('Email "%s" does not exist.', $email)); |
|
| 34 | + } |
|
| 33 | 35 | |
| 34 | 36 | return $user; |
| 35 | 37 | } |
@@ -43,11 +45,13 @@ discard block |
||
| 43 | 45 | $load_stmt->setFetchMode(\PDO::FETCH_INTO, $user); |
| 44 | 46 | $load_stmt->bindParam(1, $id); |
| 45 | 47 | |
| 46 | - if (!$load_stmt->execute()) |
|
| 47 | - throw new \Exception(sprintf('User #%s does not exist.', $id)); |
|
| 48 | + if (!$load_stmt->execute()) { |
|
| 49 | + throw new \Exception(sprintf('User #%s does not exist.', $id)); |
|
| 50 | + } |
|
| 48 | 51 | |
| 49 | - if (!$load_stmt->fetch()) |
|
| 50 | - throw new \Exception(sprintf('User #%s does not exist.', $id)); |
|
| 52 | + if (!$load_stmt->fetch()) { |
|
| 53 | + throw new \Exception(sprintf('User #%s does not exist.', $id)); |
|
| 54 | + } |
|
| 51 | 55 | |
| 52 | 56 | return $user; |
| 53 | 57 | } |
@@ -61,11 +65,13 @@ discard block |
||
| 61 | 65 | $load_stmt->setFetchMode(\PDO::FETCH_INTO, $user); |
| 62 | 66 | $load_stmt->bindParam(1, $id); |
| 63 | 67 | |
| 64 | - if (!$load_stmt->execute()) |
|
| 65 | - throw new \Exception(sprintf('User #%s does not exist.', $id)); |
|
| 68 | + if (!$load_stmt->execute()) { |
|
| 69 | + throw new \Exception(sprintf('User #%s does not exist.', $id)); |
|
| 70 | + } |
|
| 66 | 71 | |
| 67 | - if (!$load_stmt->fetch()) |
|
| 68 | - throw new \Exception(sprintf('User #%s does not exist.', $id)); |
|
| 72 | + if (!$load_stmt->fetch()) { |
|
| 73 | + throw new \Exception(sprintf('User #%s does not exist.', $id)); |
|
| 74 | + } |
|
| 69 | 75 | |
| 70 | 76 | unset($user->enabled); |
| 71 | 77 | unset($user->email); |