We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm getting the same that arose in #337 after merge during a PHPStan patch upgrade with Renovate:
1.10.55
1.10.56
1.3.6
1.3.7
Before I used @template-extends AbstractType<void>, now it fails every time, with or without the annotation.
@template-extends AbstractType<void>
Code example:
<?php declare(strict_types=1); namespace AppBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\FileType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Validator\Constraints\File; /** * @template-extends AbstractType<mixed> */ class UploadFileType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options): void { $builder->add( 'file', FileType::class, [ 'label' => 'Zip', 'required' => true, 'constraints' => [ new File([ 'mimeTypes' => [ 'application/zip', ], 'mimeTypesMessage' => 'Please upload a valid zip file', ]), ], ] ); $builder->add('submit', SubmitType::class, ['attr' => ['class' => 'btn-primary'], 'label' => 'Save']); $builder->setMethod(Request::METHOD_POST); parent::buildForm($builder, $options); } }
Error:
$ vendor/bin/phpstan analyze src/Form/UploadFileType.php Note: Using configuration file /var/www/***/***/phpstan.neon. 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% ------ ------------------------------------------------------------------------------------------ Line UploadFileType.php ------ ------------------------------------------------------------------------------------------ 19 Parameter $builder of method AppBundle\Form\UploadFileType::buildForm() has invalid type Symfony\Component\Form\TData. ------ ------------------------------------------------------------------------------------------ [ERROR] Found 1 error
The text was updated successfully, but these errors were encountered:
use null, not mixed or void
null
mixed
void
@template-extends AbstractType<null>
Sorry, something went wrong.
No branches or pull requests
I'm getting the same that arose in #337 after merge during a PHPStan patch upgrade with Renovate:
1.10.55
->1.10.56
1.3.6
->1.3.7
Before I used
@template-extends AbstractType<void>
, now it fails every time, with or without the annotation.Code example:
Error:
The text was updated successfully, but these errors were encountered: