Your project must not use PHP super globals
- Read doc
- Productivity
- Critical
More information: https://insight.symfony.com/what-we-analyse/symfony.use_super_globals
- public function __invoke(SendContactEmail $message): void
- {
- $email = (new Email())
- ->from($message->getEmail())
- ->to($_ENV['EMAIL_TO'])
- ->subject("Portfolio contact from {$message->getName()}")
- ->html("
- <h2>New contact from your portfolio</h2>
- <p><strong>Name:</strong> {$message->getName()}</p>
- <p><strong>Email:</strong> {$message->getEmail()}</p>
Your project files must be encoded in UTF-8
- Read doc
- Reputation
- Critical
More information: https://insight.symfony.com/what-we-analyse/web.non_utf8_encoding
Your project must provide a favicon in its public directory
- Read doc
- Reputation
- Critical
More information: https://insight.symfony.com/what-we-analyse/web.missing_favicon
-
public
- index.php
Your project error pages must be customised 2
- Read doc
- Reputation
- Critical
More information: https://insight.symfony.com/what-we-analyse/symfony.configuration.error_pages_should_be_customised
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
- public function __invoke(SendContactEmail $message): void
- {
- $email = (new Email())
- ->from($message->getEmail())
- ->to($_ENV['EMAIL_TO'])
- ->subject("Portfolio contact from {$message->getName()}")
- ->html("
- <h2>New contact from your portfolio</h2>
- <p><strong>Name:</strong> {$message->getName()}</p>
- <p><strong>Email:</strong> {$message->getEmail()}</p>
- $this->mailer->send($email);
- $contact = $this->contactRepository->find($message->getContactId());
- if ($contact) {
- $contact->setStatus('sent');
- $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)
- );
- $user = new User();
- $user->setUsername($username);
- $user->setRoles(['ROLE_ADMIN']);
- $user->setPassword(
- $this->passwordHasher->hashPassword($user, $password)
- );
- $this->entityManager->persist($user);
- $this->entityManager->flush();
- return;
- }
- $contact = $this->contactRepository->find($message->getContactId());
- if ($contact) {
- $contact->setStatus('failed');
- $this->entityManager->flush();
- }
- }
- }
- private readonly MessageBusInterface $bus,
- ) {}
- public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): Contact
- {
- $this->entityManager->persist($data);
- $this->entityManager->flush();
- $this->bus->dispatch(new SendContactEmail(
- $data->getName(),
- $data->getEmail(),
- {
- $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;
- }
- }
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 should not use invalid return types 5
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_return_typehint
- $data->getEmail(),
- $data->getMessage(),
- $data->getId(),
- ));
- return $data;
- }
- }
- public function getRoles(): array
- {
- $roles = $this->roles;
- $roles[] = 'ROLE_USER';
- return array_unique($roles);
- }
- public function setRoles(array $roles): static
- {
- $this->roles = $roles;
- return $this;
- }
- public function getUserIdentifier(): string
- {
- return (string) $this->username;
- }
- public function eraseCredentials(): void {}
- }
- parent::__construct($registry, Experience::class);
- }
- public function findAllWithTasks(): array
- {
- return $this->createQueryBuilder('e')
- ->addSelect('t')
- ->leftJoin('e.tasks', 't')
- ->orderBy('e.startedAt', 'DESC')
- ->getQuery()
- ->getResult();
- parent::__construct($registry, Project::class);
- }
- public function findAllWithTechnologies(): array
- {
- return $this->createQueryBuilder('p')
- ->addSelect('t', 'i')
- ->leftJoin('p.technologies', 't')
- ->leftJoin('p.image', 'i')
- ->orderBy('p.id', 'DESC')
- ->getQuery()
Your project should not use invalid parameter and return typehints
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_typehint
- $roles = $this->roles;
- $roles[] = 'ROLE_USER';
- return array_unique($roles);
- }
- public function setRoles(array $roles): static
- {
- $this->roles = $roles;
- return $this;
- }
Your project should use return types 4
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.missing_return_typehint
- public function __construct(ManagerRegistry $registry)
- {
- parent::__construct($registry, Experience::class);
- }
- public function findAllWithTasks(): array
- {
- return $this->createQueryBuilder('e')
- ->addSelect('t')
- ->leftJoin('e.tasks', 't')
- ->orderBy('e.startedAt', 'DESC')
- public function __construct(ManagerRegistry $registry)
- {
- parent::__construct($registry, Project::class);
- }
- public function findAllWithTechnologies(): array
- {
- return $this->createQueryBuilder('p')
- ->addSelect('t', 'i')
- ->leftJoin('p.technologies', 't')
- ->leftJoin('p.image', 'i')
- {
- $this->companyName = $companyName;
- return $this;
- }
- public function getTasks(): Collection { return $this->tasks; }
- public function addTask(Task $task): static
- {
- if (!$this->tasks->contains($task)) {
- $this->tasks->add($task);
- {
- $this->image = $image;
- return $this;
- }
- public function getTechnologies(): Collection { return $this->technologies; }
- public function addTechnology(Technology $technology): static
- {
- if (!$this->technologies->contains($technology)) {
- $this->technologies->add($technology);
Your project should contain a robots.txt file
- Read doc
- Reputation
- Major
More information: https://insight.symfony.com/what-we-analyse/web.missing_robots_txt
-
public
- index.php
Your project session configuration could expose your users data
- Read doc
- Legal
- Data leak
- Major
More information: https://insight.symfony.com/what-we-analyse/symfony.request.session_cookie_default_name
Web applications should contain a site.webmanifest file
- Read doc
- Reputation
- Minor
More information: https://insight.symfony.com/what-we-analyse/web.missing_web_manifest
-
public
- index.php
Text files should end with a valid new line character. 34
- Read doc
- Productivity
- Info
More information: https://insight.symfony.com/what-we-analyse/missing_e_o_l
- if ($contact) {
- $contact->setStatus('sent');
- $this->entityManager->flush();
- }
- }
- }