-
Notifications
You must be signed in to change notification settings - Fork 55
I get PropertyNotSetInConstructor when extending the symfony Response class #290
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
Comments
@loevgaard hello, can you please try it like the following? <?php
declare(strict_types=1);
namespace Setono\SyliusGiftCardPlugin\Renderer;
use Symfony\Component\HttpFoundation\HeaderUtils;
use Symfony\Component\HttpFoundation\Response;
final class PdfResponse extends Response
{
public function __construct(string $content, string $filename = 'gift_card.pdf')
{
$disposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_ATTACHMENT, $filename);
parent::__construct($content, 200, [
'Content-Type' => 'application/pdf',
'Content-Disposition' => $disposition,
]);
}
} |
Yes, that works. I guess the other problem is actually a Psalm issue. When the Thanks anyways! |
I was too fast. I forgot to clear the cache: Here are the errors I have after that change:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi
I have this class:
I am using
v4.0.0
of this Psalm plugin and I get the following errors:Am I doing something wrong or why doesn't Psalm understand that these are invalid errors?
The text was updated successfully, but these errors were encountered: