mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-23 02:09:03 +02:00
Fixed static analysis issues.
This commit is contained in:
parent
51e05a8669
commit
58ada496e4
4 changed files with 11 additions and 4 deletions
|
@ -51,6 +51,7 @@ use App\Entity\LogSystem\ElementCreatedLogEntry;
|
|||
use App\Entity\LogSystem\ElementDeletedLogEntry;
|
||||
use App\Entity\LogSystem\ElementEditedLogEntry;
|
||||
use App\Form\Filters\LogFilterType;
|
||||
use App\Repository\DBElementRepository;
|
||||
use App\Services\LogSystem\EventUndoHelper;
|
||||
use App\Services\LogSystem\TimeTravel;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
@ -71,7 +72,7 @@ class LogController extends AbstractController
|
|||
{
|
||||
protected EntityManagerInterface $entityManager;
|
||||
protected TimeTravel $timeTravel;
|
||||
protected EntityRepository $dbRepository;
|
||||
protected DBElementRepository $dbRepository;
|
||||
|
||||
public function __construct(EntityManagerInterface $entityManager, TimeTravel $timeTravel)
|
||||
{
|
||||
|
|
|
@ -85,7 +85,7 @@ class PasswordResetManager
|
|||
}
|
||||
|
||||
$unencrypted_token = md5(random_bytes(32));
|
||||
$user->setPwResetToken($this->passwordEncoder->hash($unencrypted_token, null));
|
||||
$user->setPwResetToken($this->passwordEncoder->hash($unencrypted_token));
|
||||
|
||||
//Determine the expiration datetime of
|
||||
$expiration_date = new DateTime();
|
||||
|
@ -140,7 +140,7 @@ class PasswordResetManager
|
|||
}
|
||||
|
||||
//Check if token is valid
|
||||
if (!$this->passwordEncoder->verify($user->getPwResetToken(), $token, null)) {
|
||||
if (!$this->passwordEncoder->verify($user->getPwResetToken(), $token)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,9 @@ class NodesListBuilder
|
|||
return $this->cache->get($key, function (ItemInterface $item) use ($class_name, $parent, $secure_class_name) {
|
||||
// Invalidate when groups, a element with the class or the user changes
|
||||
$item->tag(['groups', 'tree_list', $this->keyGenerator->generateKey(), $secure_class_name]);
|
||||
return $this->em->getRepository($class_name)->toNodesList($parent);
|
||||
/** @var StructuralDBElementRepository $repo */
|
||||
$repo = $this->em->getRepository($class_name);
|
||||
return $repo->toNodesList($parent);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -73,6 +73,10 @@ class UserCacheKeyGenerator
|
|||
$user = $this->security->getUser();
|
||||
}
|
||||
|
||||
if (!$user instanceof User){
|
||||
throw new \RuntimeException('UserCacheKeyGenerator::generateKey() was called without a user, but no user is logged in!');
|
||||
}
|
||||
|
||||
//If the user is null, then treat it as anonymous user.
|
||||
//When the anonymous user is passed as user then use this path too.
|
||||
if (null === $user || User::ID_ANONYMOUS === $user->getID()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue