@@ -56,14 +56,14 @@ discard block |
||
| 56 | 56 | public function userInfo(?User $user, Packages $packages) |
| 57 | 57 | { |
| 58 | 58 | //If no user id was passed, then we show info about the current user |
| 59 | - if($user == null) { |
|
| 59 | + if ($user == null) { |
|
| 60 | 60 | $user = $this->getUser(); |
| 61 | 61 | } else { |
| 62 | 62 | //Else we must check, if the current user is allowed to access $user |
| 63 | 63 | $this->denyAccessUnlessGranted('read', $user); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - if($this->getParameter("use_gravatar")) { |
|
| 66 | + if ($this->getParameter("use_gravatar")) { |
|
| 67 | 67 | $avatar = $this->getGravatar($user->getEmail(), 200, 'identicon'); |
| 68 | 68 | } else { |
| 69 | 69 | $avatar = $packages->getUrl("/img/default_avatar.png"); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $pw_form->handleRequest($request); |
| 128 | 128 | |
| 129 | 129 | //Check if password if everything was correct, then save it to User and DB |
| 130 | - if($pw_form->isSubmitted() && $pw_form->isValid()) { |
|
| 130 | + if ($pw_form->isSubmitted() && $pw_form->isValid()) { |
|
| 131 | 131 | $password = $passwordEncoder->encodePassword($user, $pw_form['new_password']->getData()); |
| 132 | 132 | $user->setPassword($password); |
| 133 | 133 | $em->persist($user); |
@@ -164,9 +164,9 @@ discard block |
||
| 164 | 164 | $url .= md5(strtolower(trim($email))); |
| 165 | 165 | $url .= "?s=$s&d=$d&r=$r"; |
| 166 | 166 | if ($img) { |
| 167 | - $url = '<img src="' . $url . '"'; |
|
| 167 | + $url = '<img src="'.$url.'"'; |
|
| 168 | 168 | foreach ($atts as $key => $val) { |
| 169 | - $url .= ' ' . $key . '="' . $val . '"'; |
|
| 169 | + $url .= ' '.$key.'="'.$val.'"'; |
|
| 170 | 170 | } |
| 171 | 171 | $url .= ' />'; |
| 172 | 172 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | protected function supports($attribute, $subject) |
| 49 | 49 | { |
| 50 | - if($subject instanceof User) |
|
| 50 | + if ($subject instanceof User) |
|
| 51 | 51 | { |
| 52 | 52 | return in_array($attribute, array_merge( |
| 53 | 53 | $this->resolver->listOperationsForPermission('users'), |
@@ -69,15 +69,15 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | protected function voteOnUser($attribute, $subject, User $user): bool |
| 71 | 71 | { |
| 72 | - if($subject instanceof User) |
|
| 72 | + if ($subject instanceof User) |
|
| 73 | 73 | { |
| 74 | 74 | //Check if the checked user is the user itself |
| 75 | - if($subject->getID() === $user->getID() && |
|
| 75 | + if ($subject->getID() === $user->getID() && |
|
| 76 | 76 | $this->resolver->isValidOperation('self', $attribute)) { |
| 77 | 77 | //Then we also need to check the self permission |
| 78 | 78 | $tmp = $this->resolver->inherit($user, 'self', $attribute) ?? false; |
| 79 | 79 | //But if the self value is not allowed then use just the user value: |
| 80 | - if($tmp) |
|
| 80 | + if ($tmp) |
|
| 81 | 81 | return $tmp; |
| 82 | 82 | } |
| 83 | 83 | //Else just check users permission: |
@@ -77,8 +77,9 @@ |
||
| 77 | 77 | //Then we also need to check the self permission |
| 78 | 78 | $tmp = $this->resolver->inherit($user, 'self', $attribute) ?? false; |
| 79 | 79 | //But if the self value is not allowed then use just the user value: |
| 80 | - if($tmp) |
|
| 81 | - return $tmp; |
|
| 80 | + if($tmp) { |
|
| 81 | + return $tmp; |
|
| 82 | + } |
|
| 82 | 83 | } |
| 83 | 84 | //Else just check users permission: |
| 84 | 85 | return $this->resolver->inherit($user, 'users', $attribute) ?? false; |