mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 10:49:00 +02:00
Fixed PHPstan issues.
This commit is contained in:
parent
22a200e261
commit
28187f1ef2
2 changed files with 3 additions and 1 deletions
|
@ -67,7 +67,7 @@ final class LabelHTMLGenerator
|
|||
|
||||
$page = 1;
|
||||
foreach ($elements as $element) {
|
||||
if ($options->getLinesMode() === 'twig' && $sandboxed_twig !== null) {
|
||||
if ($options->getLinesMode() === 'twig' && isset($sandboxed_twig) && isset($current_user)) {
|
||||
try {
|
||||
$lines = $sandboxed_twig->render(
|
||||
'lines',
|
||||
|
|
|
@ -22,6 +22,7 @@ namespace App\Services\LabelSystem;
|
|||
|
||||
|
||||
use App\Entity\LabelSystem\LabelProfile;
|
||||
use App\Repository\LabelProfileRepository;
|
||||
use App\Services\UserCacheKeyGenerator;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Contracts\Cache\ItemInterface;
|
||||
|
@ -45,6 +46,7 @@ class LabelProfileDropdownHelper
|
|||
$secure_class_name = str_replace('\\', '_', LabelProfile::class);
|
||||
$key = 'profile_dropdown_'.$this->keyGenerator->generateKey().'_'.$secure_class_name . '_' . $type;
|
||||
|
||||
/** @var LabelProfileRepository $repo */
|
||||
$repo = $this->entityManager->getRepository(LabelProfile::class);
|
||||
|
||||
return $this->cache->get($key, function (ItemInterface $item) use ($repo, $type, $secure_class_name) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue