Your project must not contain invalid instantiations 5
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_instantiation
- $this->entityManager->persist($data);
- $this->entityManager->flush();
- $this->bus->dispatch(new SendContactEmail(
- $data->getName(),
- $data->getEmail(),
- $data->getMessage(),
- $data->getId(),
- ));
- $this->entityManager->persist($data);
- $this->entityManager->flush();
- $this->bus->dispatch(new SendContactEmail(
- $data->getName(),
- $data->getEmail(),
- $data->getMessage(),
- $data->getId(),
- ));
- return $data;
- $this->entityManager->flush();
- $this->bus->dispatch(new SendContactEmail(
- $data->getName(),
- $data->getEmail(),
- $data->getMessage(),
- $data->getId(),
- ));
- return $data;
- }
- $this->bus->dispatch(new SendContactEmail(
- $data->getName(),
- $data->getEmail(),
- $data->getMessage(),
- $data->getId(),
- ));
- return $data;
- }
- }
- use App\Kernel;
- require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
- return function (array $context) {
- return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
- };
Your project must not contain invalid function or method calls 10
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_call
- $user = new User();
- $user->setUsername($username);
- $user->setRoles(['ROLE_ADMIN']);
- $user->setPassword(
- $this->passwordHasher->hashPassword($user, $password)
- );
- $this->entityManager->persist($user);
- $this->entityManager->flush();
- $username = $input->getArgument('username');
- $password = $input->getArgument('password');
- $user = new User();
- $user->setUsername($username);
- $user->setRoles(['ROLE_ADMIN']);
- $user->setPassword(
- $this->passwordHasher->hashPassword($user, $password)
- );
- return;
- }
- $contact = $this->contactRepository->find($message->getContactId());
- if ($contact) {
- $contact->setStatus('failed');
- $this->entityManager->flush();
- }
- }
- }
- };
- // Preserve transparency for PNG and GIF
- if (in_array($mime, ['image/png', 'image/gif'])) {
- imagepalettetotruecolor($source);
- imagealphablending($source, true);
- imagesavealpha($source, true);
- }
- imagewebp($source, $outputPath, 85);
- imagedestroy($source);
- default => throw new BadRequestHttpException('Unsupported image type.'),
- };
- // Preserve transparency for PNG and GIF
- if (in_array($mime, ['image/png', 'image/gif'])) {
- imagepalettetotruecolor($source);
- imagealphablending($source, true);
- imagesavealpha($source, true);
- }
- imagewebp($source, $outputPath, 85);
- imagealphablending($source, true);
- imagesavealpha($source, true);
- }
- imagewebp($source, $outputPath, 85);
- imagedestroy($source);
- }
- }
- // Preserve transparency for PNG and GIF
- if (in_array($mime, ['image/png', 'image/gif'])) {
- imagepalettetotruecolor($source);
- imagealphablending($source, true);
- imagesavealpha($source, true);
- }
- imagewebp($source, $outputPath, 85);
- imagedestroy($source);
- }
- imagepalettetotruecolor($source);
- imagealphablending($source, true);
- imagesavealpha($source, true);
- }
- imagewebp($source, $outputPath, 85);
- imagedestroy($source);
- }
- }
- $this->mailer->send($email);
- $contact = $this->contactRepository->find($message->getContactId());
- if ($contact) {
- $contact->setStatus('sent');
- $this->entityManager->flush();
- }
- }
- }
- $files = [$files];
- }
- $uploaded = [];
- foreach ($files as $file) {
- $image = $imageUploadService->upload($file);
- $uploaded[] = [
- 'id' => $image->getId(),
- 'filename' => $image->getFilename(),
- 'url' => $request->getSchemeAndHttpHost() . '/images/' . $image->getFilename(),
- 'uploaded_at' => $image->getUploadedAt()->format('Y-m-d H:i:s'),
Text files should end with a valid new line character. 4
- Read doc
- Productivity
- Info
More information: https://insight.symfony.com/what-we-analyse/missing_e_o_l
- <h1>Access Denied : Error 403</h1>
- <p>
- The request is denied.
- </p>
- {% endblock %}
- <p>
- The requested page couldn't be located. Checkout for any URL
- misspelling.
- </p>
- {% endblock %}
- arguments:
- $uploadDir: '%kernel.project_dir%/public/images'
- App\MessageHandler\SendContactEmailHandler:
- arguments:
- $emailTo: '%env(EMAIL_TO)%'
- <h1>Internal Server Error : Error 500</h1>
- <p>
- There was an error.
- </p>
- {% endblock %}