Your project must not contain invalid function or method calls 9

More information: https://insight.symfony.com/what-we-analyse/php.invalid_call

  1. parent::configureOptions($resolver);
  2. $resolver->setNormalizer(
  3. 'constraints',
  4. function (Options $options, mixed $constraints): array {
  5. $this->getManager($options['class'], $options['lookup_field']);
    Parameter #1 $class of method JG\BatchEntityImportBundle\Form\Type\AbstractEntityLookupType::getManager() expects string, mixed given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Jarosław Grygierek
  6. /** @var Constraint[] $constraints */
  7. $constraints = \is_array($constraints) ? $constraints : [$constraints];
  8. $constraints[] = new RelatedEntityExists(class: $options['class'], lookupField: $options['lookup_field']);
  1. parent::configureOptions($resolver);
  2. $resolver->setNormalizer(
  3. 'constraints',
  4. function (Options $options, mixed $constraints): array {
  5. $this->getManager($options['class'], $options['lookup_field']);
    Parameter #2 $lookupField of method JG\BatchEntityImportBundle\Form\Type\AbstractEntityLookupType::getManager() expects string, mixed given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Jarosław Grygierek
  6. /** @var Constraint[] $constraints */
  7. $constraints = \is_array($constraints) ? $constraints : [$constraints];
  8. $constraints[] = new RelatedEntityExists(class: $options['class'], lookupField: $options['lookup_field']);
  1. parent::configureOptions($resolver);
  2. $resolver->setDefaults([
  3. 'placeholder' => '---',
  4. 'translation_domain' => false,
  5. 'choices' => fn (Options $options): array => $this->getChoices($options['class'], $options['lookup_field']),
    Parameter #2 $lookupField of method JG\BatchEntityImportBundle\Form\Type\EntityLookupType::getChoices() expects string, mixed given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Jarosław Grygierek
  6. ]);
  7. }
  8. /**
  9. * Called between requests in long-running processes, so new entities are visible.
  1. parent::configureOptions($resolver);
  2. $resolver->setDefaults([
  3. 'placeholder' => '---',
  4. 'translation_domain' => false,
  5. 'choices' => fn (Options $options): array => $this->getChoices($options['class'], $options['lookup_field']),
    Parameter #1 $class of method JG\BatchEntityImportBundle\Form\Type\EntityLookupType::getChoices() expects string, mixed given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Jarosław Grygierek
  6. ]);
  7. }
  8. /**
  9. * Called between requests in long-running processes, so new entities are visible.
  1. }
  2. $manager = $this->getManager($class, $lookupField);
  3. $propertyAccessor = PropertyAccess::createPropertyAccessor();
  4. $choices = [];
  5. foreach ($manager->getRepository($class)->findAll() as $entity) {
    Parameter #1 $className of method Doctrine\Persistence\ObjectManager::getRepository() expects class-string<object>, string given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Jarosław Grygierek
  6. /** @var string|int|null $value */
  7. $value = $propertyAccessor->getValue($entity, $lookupField);
  8. if (null === $value || '' === $value) {
  9. continue;
  10. }
  1. }
  2. $manager = $this->getManager($class, $lookupField);
  3. $propertyAccessor = PropertyAccess::createPropertyAccessor();
  4. $choices = [];
  5. foreach ($manager->getRepository($class)->findAll() as $entity) {
    Unable to resolve the template type T in call to method Doctrine\Persistence\ObjectManager::getRepository()
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Jarosław Grygierek
  6. /** @var string|int|null $value */
  7. $value = $propertyAccessor->getValue($entity, $lookupField);
  8. if (null === $value || '' === $value) {
  9. continue;
  10. }
  1. $manager = $this->getManagerForClass($class);
  2. if (!$manager) {
  3. throw new InvalidArgumentException(\sprintf('Class "%s" is not a managed Doctrine entity.', $class));
  4. }
  5. if (!$manager->getClassMetadata($class)->hasField($lookupField)) {
    Unable to resolve the template type T in call to method Doctrine\Persistence\ObjectManager::getClassMetadata()
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Jarosław Grygierek
  6. throw new InvalidArgumentException(\sprintf('Field "%s" does not exist in entity "%s".', $lookupField, $class));
  7. }
  8. return $manager;
  9. }
  1. $manager = $this->getManagerForClass($class);
  2. if (!$manager) {
  3. throw new InvalidArgumentException(\sprintf('Class "%s" is not a managed Doctrine entity.', $class));
  4. }
  5. if (!$manager->getClassMetadata($class)->hasField($lookupField)) {
    Parameter #1 $className of method Doctrine\Persistence\ObjectManager::getClassMetadata() expects class-string<object>, string given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Jarosław Grygierek
  6. throw new InvalidArgumentException(\sprintf('Field "%s" does not exist in entity "%s".', $lookupField, $class));
  7. }
  8. return $manager;
  9. }
  1. }
  2. private function getManagerForClass(string $class): ?ObjectManager
  3. {
  4. if ($this->managers instanceof ManagerRegistry) {
  5. return $this->managers->getManagerForClass($class);
    Parameter #1 $class of method Doctrine\Persistence\ManagerRegistry::getManagerForClass() expects class-string, string given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by Jarosław Grygierek
  6. }
  7. return \class_exists($class) && !$this->managers->getMetadataFactory()->isTransient($class)
  8. ? $this->managers
  9. : null;

Your project must not contain invalid instantiations 2

More information: https://insight.symfony.com/what-we-analyse/php.invalid_instantiation

  1. function (Options $options, mixed $constraints): array {
  2. $this->getManager($options['class'], $options['lookup_field']);
  3. /** @var Constraint[] $constraints */
  4. $constraints = \is_array($constraints) ? $constraints : [$constraints];
  5. $constraints[] = new RelatedEntityExists(class: $options['class'], lookupField: $options['lookup_field']);
    Parameter $class of class JG\BatchEntityImportBundle\Validator\Constraints\RelatedEntityExists constructor expects string, mixed given.
    Last edited by Jarosław Grygierek
  6. return $constraints;
  7. },
  8. );
  9. }
  1. function (Options $options, mixed $constraints): array {
  2. $this->getManager($options['class'], $options['lookup_field']);
  3. /** @var Constraint[] $constraints */
  4. $constraints = \is_array($constraints) ? $constraints : [$constraints];
  5. $constraints[] = new RelatedEntityExists(class: $options['class'], lookupField: $options['lookup_field']);
    Parameter $lookupField of class JG\BatchEntityImportBundle\Validator\Constraints\RelatedEntityExists constructor expects string, mixed given.
    Last edited by Jarosław Grygierek
  6. return $constraints;
  7. },
  8. );
  9. }