Your project must not contain invalid instantiations 5

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

  1. $this->entityManager->persist($data);
  2. $this->entityManager->flush();
  3. $this->bus->dispatch(new SendContactEmail(
  4. $data->getName(),
    Parameter #1 $name of class App\Message\SendContactEmail constructor expects string, string|null given.
    Time to fix: about 1 hour
    Read doc Permalink Copy Prompt
    Last edited by Luigi Gandemer
  5. $data->getEmail(),
  6. $data->getMessage(),
  7. $data->getId(),
  8. ));
  1. $this->entityManager->persist($data);
  2. $this->entityManager->flush();
  3. $this->bus->dispatch(new SendContactEmail(
  4. $data->getName(),
  5. $data->getEmail(),
    Parameter #2 $email of class App\Message\SendContactEmail constructor expects string, string|null given.
    Time to fix: about 1 hour
    Read doc Permalink Copy Prompt
    Last edited by Luigi Gandemer
  6. $data->getMessage(),
  7. $data->getId(),
  8. ));
  9. return $data;
  1. $this->entityManager->flush();
  2. $this->bus->dispatch(new SendContactEmail(
  3. $data->getName(),
  4. $data->getEmail(),
  5. $data->getMessage(),
    Parameter #3 $message of class App\Message\SendContactEmail constructor expects string, string|null given.
    Time to fix: about 1 hour
    Read doc Permalink Copy Prompt
    Last edited by Luigi Gandemer
  6. $data->getId(),
  7. ));
  8. return $data;
  9. }
  1. $this->bus->dispatch(new SendContactEmail(
  2. $data->getName(),
  3. $data->getEmail(),
  4. $data->getMessage(),
  5. $data->getId(),
    Parameter #4 $contactId of class App\Message\SendContactEmail constructor expects int, int|null given.
    Time to fix: about 1 hour
    Read doc Permalink Copy Prompt
    Last edited by Luigi Gandemer
  6. ));
  7. return $data;
  8. }
  9. }
in public/index.php, line 8
  1. use App\Kernel;
  2. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  3. return function (array $context) {
  4. return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
    Parameter #1 $environment of class App\Kernel constructor expects string, mixed given.
    Time to fix: about 1 hour
    Read doc Permalink Copy Prompt
    Last edited by Luigi Gandemer
  5. };

Your project must not contain invalid function or method calls 10

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

  1. $user = new User();
  2. $user->setUsername($username);
  3. $user->setRoles(['ROLE_ADMIN']);
  4. $user->setPassword(
  5. $this->passwordHasher->hashPassword($user, $password)
    Parameter #2 $plainPassword of method Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface::hashPassword() expects string, mixed given.
    Time to fix: about 9 minutes
    Read doc Permalink Copy Prompt
    Last edited by Luigi Gandemer
  6. );
  7. $this->entityManager->persist($user);
  8. $this->entityManager->flush();
  1. $username = $input->getArgument('username');
  2. $password = $input->getArgument('password');
  3. $user = new User();
  4. $user->setUsername($username);
    Parameter #1 $username of method App\Entity\User::setUsername() expects string, mixed given.
    Time to fix: about 9 minutes
    Read doc Permalink Copy Prompt
    Last edited by Luigi Gandemer
  5. $user->setRoles(['ROLE_ADMIN']);
  6. $user->setPassword(
  7. $this->passwordHasher->hashPassword($user, $password)
  8. );
  1. return;
  2. }
  3. $contact = $this->contactRepository->find($message->getContactId());
  4. if ($contact) {
  5. $contact->setStatus('failed');
    Call to an undefined method object::setStatus().
    Time to fix: about 9 minutes
    Read doc Permalink Copy Prompt
    Last edited by Luigi Gandemer
  6. $this->entityManager->flush();
  7. }
  8. }
  9. }
  1. };
  2. // Preserve transparency for PNG and GIF
  3. if (in_array($mime, ['image/png', 'image/gif'])) {
  4. imagepalettetotruecolor($source);
  5. imagealphablending($source, true);
    Parameter #1 $image of function imagealphablending expects GdImage, GdImage|false given.
    Time to fix: about 9 minutes
    Read doc Permalink Copy Prompt
    Last edited by Luigi Gandemer
  6. imagesavealpha($source, true);
  7. }
  8. imagewebp($source, $outputPath, 85);
  9. imagedestroy($source);
  1. default => throw new BadRequestHttpException('Unsupported image type.'),
  2. };
  3. // Preserve transparency for PNG and GIF
  4. if (in_array($mime, ['image/png', 'image/gif'])) {
  5. imagepalettetotruecolor($source);
    Parameter #1 $image of function imagepalettetotruecolor expects GdImage, GdImage|false given.
    Time to fix: about 9 minutes
    Read doc Permalink Copy Prompt
    Last edited by Luigi Gandemer
  6. imagealphablending($source, true);
  7. imagesavealpha($source, true);
  8. }
  9. imagewebp($source, $outputPath, 85);
  1. imagealphablending($source, true);
  2. imagesavealpha($source, true);
  3. }
  4. imagewebp($source, $outputPath, 85);
  5. imagedestroy($source);
    Parameter #1 $image of function imagedestroy expects GdImage, GdImage|false given.
    Time to fix: about 9 minutes
    Read doc Permalink Copy Prompt
    Last edited by Luigi Gandemer
  6. }
  7. }
  1. // Preserve transparency for PNG and GIF
  2. if (in_array($mime, ['image/png', 'image/gif'])) {
  3. imagepalettetotruecolor($source);
  4. imagealphablending($source, true);
  5. imagesavealpha($source, true);
    Parameter #1 $image of function imagesavealpha expects GdImage, GdImage|false given.
    Time to fix: about 9 minutes
    Read doc Permalink Copy Prompt
    Last edited by Luigi Gandemer
  6. }
  7. imagewebp($source, $outputPath, 85);
  8. imagedestroy($source);
  9. }
  1. imagepalettetotruecolor($source);
  2. imagealphablending($source, true);
  3. imagesavealpha($source, true);
  4. }
  5. imagewebp($source, $outputPath, 85);
    Parameter #1 $image of function imagewebp expects GdImage, GdImage|false given.
    Time to fix: about 9 minutes
    Read doc Permalink Copy Prompt
    Last edited by Luigi Gandemer
  6. imagedestroy($source);
  7. }
  8. }
  1. $this->mailer->send($email);
  2. $contact = $this->contactRepository->find($message->getContactId());
  3. if ($contact) {
  4. $contact->setStatus('sent');
    Call to an undefined method object::setStatus().
    Time to fix: about 9 minutes
    Read doc Permalink Copy Prompt
    Last edited by Luigi Gandemer
  5. $this->entityManager->flush();
  6. }
  7. }
  8. }
  1. $files = [$files];
  2. }
  3. $uploaded = [];
  4. foreach ($files as $file) {
  5. $image = $imageUploadService->upload($file);
    Parameter #1 $file of method App\Service\ImageUploadService::upload() expects Symfony\Component\HttpFoundation\File\UploadedFile, mixed given.
    Time to fix: about 9 minutes
    Read doc Permalink Copy Prompt
    Last edited by Luigi Gandemer
  6. $uploaded[] = [
  7. 'id' => $image->getId(),
  8. 'filename' => $image->getFilename(),
  9. 'url' => $request->getSchemeAndHttpHost() . '/images/' . $image->getFilename(),
  10. 'uploaded_at' => $image->getUploadedAt()->format('Y-m-d H:i:s'),

Text files should end with a valid new line character. 4

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

  1. <h1>Access Denied : Error 403</h1>
  2. <p>
  3. The request is denied.
  4. </p>
  5. {% endblock %}
    This file ends with no newline character, or with a different newline character than other files in your project. It won't render properly on a terminal, and it's considered a bad practice.
    Time to fix: about 15 minutes
    Read doc Permalink Copy Prompt
    Last edited by Luigi Gandemer
  1. <p>
  2. The requested page couldn't be located. Checkout for any URL
  3. misspelling.
  4. </p>
  5. {% endblock %}
    This file ends with no newline character, or with a different newline character than other files in your project. It won't render properly on a terminal, and it's considered a bad practice.
    Time to fix: about 15 minutes
    Read doc Permalink Copy Prompt
    Last edited by Luigi Gandemer
in config/services.yaml, line 28
  1. arguments:
  2. $uploadDir: '%kernel.project_dir%/public/images'
  3. App\MessageHandler\SendContactEmailHandler:
  4. arguments:
  5. $emailTo: '%env(EMAIL_TO)%'
    This file ends with no newline character, or with a different newline character than other files in your project. It won't render properly on a terminal, and it's considered a bad practice.
    Time to fix: about 15 minutes
    Read doc Permalink Copy Prompt
    Last edited by Luigi Gandemer
  1. <h1>Internal Server Error : Error 500</h1>
  2. <p>
  3. There was an error.
  4. </p>
  5. {% endblock %}
    This file ends with no newline character, or with a different newline character than other files in your project. It won't render properly on a terminal, and it's considered a bad practice.
    Time to fix: about 15 minutes
    Read doc Permalink Copy Prompt
    Last edited by Luigi Gandemer