Skip to content

Commit ac29314

Browse files
committed
code format
1 parent 58c5622 commit ac29314

2 files changed

Lines changed: 26 additions & 25 deletions

File tree

src/Service/AuthAdapter.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ protected function validateUser(?UserInterface $user): Result
234234
* @param string $token
235235
* @return mixed
236236
*/
237-
public function getUserByToken(string $token) {
237+
public function getUserByToken(string $token)
238+
{
238239
return $this->entityManager->getRepository(User::class)
239240
->findOneByToken($token);
240241
}
@@ -244,7 +245,8 @@ public function getUserByToken(string $token) {
244245
* @param string $email
245246
* @return mixed
246247
*/
247-
public function getUserByEmail(string $email){
248+
public function getUserByEmail(string $email)
249+
{
248250
return $this->entityManager->getRepository(User::class)
249251
->findOneByEmail($email);
250252
}
@@ -253,7 +255,8 @@ public function getUserByEmail(string $email){
253255
* Get STATUS_RETIRED
254256
* @return int
255257
*/
256-
public function getRetiredStatus(){
258+
public function getRetiredStatus()
259+
{
257260
return User::STATUS_RETIRED;
258261
}
259262
}

src/Service/UserManager.php

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ class UserManager
3434
/**
3535
* @return EntityManager
3636
*/
37-
public function getEntityManager(): EntityManager
38-
{
39-
return $this->entityManager;
40-
}
37+
public function getEntityManager(): EntityManager
38+
{
39+
return $this->entityManager;
40+
}
4141

42-
/**
43-
* @return Bcrypt
44-
*/
45-
public function getBcrypt(): Bcrypt
46-
{
47-
return $this->bcrypt;
48-
}
42+
/**
43+
* @return Bcrypt
44+
*/
45+
public function getBcrypt(): Bcrypt
46+
{
47+
return $this->bcrypt;
48+
}
4949

5050
/**
5151
* UserManager constructor.
@@ -165,22 +165,18 @@ public function hasRole($email, $roles)
165165
{
166166
/** @var User $user */
167167
$user = $this->getUserByEmail($email);
168-
if(in_array($user->getRoleName(),$roles, true)) {
169-
return true;
170-
}
171-
return false;
168+
169+
return in_array($user->getRoleName(),$roles, true);
172170
}
173171

174172
/**
175173
* Checks whether an active user with given email address already exists in the database.
176174
* @param string $email
177175
* @return bool
178176
*/
179-
public function checkUserExists(string $email) {
180-
181-
$user = $this->getUserByEmail($email);
182-
183-
return $user !== null;
177+
public function checkUserExists(string $email)
178+
{
179+
return !empty($this->getUserByEmail($email));
184180
}
185181

186182
/**
@@ -265,7 +261,8 @@ public function validatePasswordResetToken($passwordResetToken)
265261
* @param string $passwordResetToken
266262
* @return mixed
267263
*/
268-
public function getUserByPasswordResetToken(string $passwordResetToken) {
264+
public function getUserByPasswordResetToken(string $passwordResetToken)
265+
{
269266
return $this->entityManager->getRepository(User::class)
270267
->findOneByPasswordResetToken($passwordResetToken);
271268
}
@@ -275,7 +272,8 @@ public function getUserByPasswordResetToken(string $passwordResetToken) {
275272
* @param string $email
276273
* @return mixed
277274
*/
278-
public function getUserByEmail(string $email){
275+
public function getUserByEmail(string $email)
276+
{
279277
return $this->entityManager->getRepository(User::class)
280278
->findOneByEmail($email);
281279
}

0 commit comments

Comments
 (0)