mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-21 19:34:54 +02:00
Applied rector suggestions
This commit is contained in:
parent
4106bcef5f
commit
20f32c7f12
170 changed files with 808 additions and 761 deletions
|
@ -47,7 +47,7 @@ final class OAuthTokenManager
|
|||
$tokenEntity = $this->entityManager->getRepository(OAuthToken::class)->findOneBy(['name' => $app_name]);
|
||||
|
||||
//If the token was already existing, we just replace it with the new one
|
||||
if ($tokenEntity) {
|
||||
if ($tokenEntity !== null) {
|
||||
$tokenEntity->replaceWithNewToken($token);
|
||||
|
||||
$this->entityManager->flush();
|
||||
|
@ -96,7 +96,7 @@ final class OAuthTokenManager
|
|||
{
|
||||
$token = $this->getToken($app_name);
|
||||
|
||||
if (!$token) {
|
||||
if ($token === null) {
|
||||
throw new \RuntimeException('No token was saved yet for '.$app_name);
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ final class OAuthTokenManager
|
|||
$token = $this->getToken($app_name);
|
||||
|
||||
//If the token is not existing, we return null
|
||||
if (!$token) {
|
||||
if ($token === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue