New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught InvalidArgumentException: Could not get class storage for lexik\bundle\jwtauthenticationbundle\security\authenticator\forwardcompatauthenticatortrait #8953
Comments
Hey @adeptofvoltron, can you reproduce the issue on https://psalm.dev ? |
Hello, I have the same problem. here is the detailed stack trace :
|
I removed a constructor call in classes that extends
And the init worked, so this is the culprit but how to fix it properly, i don't know. |
Note: this lib is known to have difficulties with static tools: lexik/LexikJWTAuthenticationBundle#944 It seems related to compatibility layers: I think Psalm has difficulties to extract dynamic declarations of symbols here Did it used to work and then broke? |
Hello, thank you for your time. It's a first run on my project for me and it just don't work with the constructor, init or not. I'm going to fix the whole thing without the constructor and then put it back. It looks like there is a fix on a recent version : #7863 I'm running : Psalm 5.4.0@62db5d4f6a7ae0a20f7cc5a4952d730272fc0863 So either it's not really fixed or I'm missing something. |
The backtrace is different. We would need a minimal reproducer on psalm.dev (or in a separate repo, if that's not possible on psalm.dev). |
I've the same error and this class triggers it, not sure why. <?php
declare(strict_types=1);
namespace Qbil\CommonBundle\Services;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;
use Qbil\Numbering\Domain\Entity\SupportsNumbering;
use Qbil\Numbering\Domain\Exception\InvalidNumberingScheme;
use Qbil\Numbering\Domain\Exception\NoActiveNumberingSchemeFound;
use Qbil\Numbering\Domain\Repository\NumberingSchemeRepository;
use Qbil\Numbering\Domain\Repository\RepositorySupportsGeneratingNextSequenceNumber;
use Qbil\Numbering\Domain\Services\DetermineNumberingRequirementsVisitor;
use Qbil\TradeBundle\Entity\Afroep;
use Qbil\TradeBundle\Entity\AfroepRepository;
use Qbil\TradeBundle\Entity\Contract;
use Qbil\TradeBundle\Entity\ContractRepository;
use Qbil\TradeBundle\Entity\FreeformDocument;
use Qbil\TradeBundle\Entity\FreeformDocumentRepository;
use Qbil\TradeBundle\Entity\Productieopdracht;
use Qbil\TradeBundle\Entity\ProductieopdrachtRepository;
use Qbil\TradeBundle\Entity\PurchaseInvoice;
use Qbil\TradeBundle\Entity\PurchaseInvoiceRepository;
use Qbil\TradeBundle\Entity\Salesinvoice;
use Qbil\TradeBundle\Entity\SalesinvoiceRepository;
use Qbil\TradeBundle\Entity\Transportorder;
use Qbil\TradeBundle\Entity\TransportorderRepository;
use Symfony\Contracts\Service\ServiceSubscriberInterface;
class NumberAssigner implements ServiceSubscriberInterface
{
public function __construct(
private NumberingSchemeRepository $numberingSchemeRepository,
private ContainerInterface $nextSequenceNumberGeneratorFinder,
) {
}
/**
* @throws InvalidNumberingScheme
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws \LogicException
*/
public function assignDisplayNumber(SupportsNumbering $entity): void
{
if ($entity->hasDisplayNumber()) {
return;
}
$numberingRequirements = $entity->determineNumberingRequirements(
new DetermineNumberingRequirementsVisitor(),
);
$numberingScheme = $this->numberingSchemeRepository->findNumberingScheme($numberingRequirements);
if (null === $numberingScheme) {
throw new NoActiveNumberingSchemeFound();
}
if (!$this->nextSequenceNumberGeneratorFinder->has($entity::class)) {
throw new \LogicException(\sprintf("Repository of entity '%s' is not among subscribed services.", $entity::class));
}
$repository = $this->nextSequenceNumberGeneratorFinder->get($entity::class);
if (!$repository instanceof RepositorySupportsGeneratingNextSequenceNumber) {
throw new \LogicException(\sprintf("EntityRepository '%s' does not implement '%s'", $repository::class, RepositorySupportsGeneratingNextSequenceNumber::class));
}
$displayNumber = $numberingScheme->resolve(
$entity,
$repository->generateNextSequenceNumber($entity, $numberingScheme->scheme()),
);
$entity->assignDisplayNumber($displayNumber);
}
public static function getSubscribedServices(): array
{
return [
Afroep::class => AfroepRepository::class,
Contract::class => ContractRepository::class,
FreeformDocument::class => FreeformDocumentRepository::class,
Productieopdracht::class => ProductieopdrachtRepository::class,
PurchaseInvoice::class => PurchaseInvoiceRepository::class,
Salesinvoice::class => SalesinvoiceRepository::class,
Transportorder::class => TransportorderRepository::class,
];
}
}
|
when running psalm --init
Uncaught InvalidArgumentException: Could not get class storage for lexik\bundle\jwtauthenticationbundle\security\authenticator\forwardcompatauthenticatortrait in phar:///var/www/blackbird/psalm.phar/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php:39
psalm I got in dev-master version
"lexik/jwt-authentication-bundle": "2.16.0"
the problematic file I try to ignore. I tried to run no diff etc
The text was updated successfully, but these errors were encountered: