Skip to content

Commit

Permalink
Merge pull request #2296 from coreshop/coding-standard/refactor-3.0
Browse files Browse the repository at this point in the history
[CS] Refactor
  • Loading branch information
dpfaffenbauer committed May 30, 2023
2 parents 2319a63 + 2330acc commit 98c243b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/CoreShop/Bundle/MenuBundle/Guard/PimcoreGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
namespace CoreShop\Bundle\MenuBundle\Guard;

use Knp\Menu\ItemInterface;
use Pimcore\Bundle\AdminBundle\Security\User\TokenStorageUserResolver;
use Pimcore\Model\User;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;

class PimcoreGuard
{
public function __construct(
private TokenStorageInterface $tokenStorage
private TokenStorageInterface $tokenStorage,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
use CoreShop\Component\Resource\Repository\RepositoryInterface;
use Doctrine\Persistence\ObjectManager;
use Pimcore\Model\DataObject;
use Pimcore\Model\User;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
Expand Down Expand Up @@ -62,14 +61,12 @@ protected function isGrantedOr403(): void
* @psalm-suppress UndefinedClass, UndefinedInterfaceMethod
*/
$user = $user->getUser();
}
else if (class_exists(\Pimcore\Bundle\AdminBundle\Security\User\User::class) && $user instanceof \Pimcore\Bundle\AdminBundle\Security\User\User) {
} elseif (class_exists(\Pimcore\Bundle\AdminBundle\Security\User\User::class) && $user instanceof \Pimcore\Bundle\AdminBundle\Security\User\User) {
/**
* @psalm-suppress UndefinedClass, UndefinedInterfaceMethod
*/
$user = $user->getUser();
}
else {
} else {
throw new \RuntimeException(sprintf('Unknown Pimcore Admin User Class given "%s"', get_class($user)));
}

Expand Down

0 comments on commit 98c243b

Please sign in to comment.