Symfony controller action method should not be too long

  • Major
  • Readability

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

15% of all actions have more than 20 lines. This violation is raised when more than 10% actions are too long.

Time to fix: about 33 minutes
Open Issue Permalink
Collective

The Doctrine Entity Manager should not be passed as an argument 2

  • Minor
  • Architecture

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

  1. use Hackzilla\Bundle\TicketBundle\Model\TicketMessageInterface;
  2. use Symfony\Component\Translation\TranslatorInterface;
  3. interface TicketManagerInterface
  4. {
  5. public function setEntityManager(ObjectManager $om);

    A Doctrine entity manager has been found as an argument.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Daniel Platt
  6. public function setTranslator(TranslatorInterface $translator);
  7. public function createTicket();
  1. /**
  2. * @param ObjectManager $om
  3. *
  4. * @return $this
  5. */
  6. public function setEntityManager(ObjectManager $om)

    A Doctrine entity manager has been found as an argument.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Daniel Platt
  7. {
  8. $this->objectManager = $om;
  9. $this->ticketRepository = $om->getRepository($this->ticketClass);
  10. $this->messageRepository = $om->getRepository($this->ticketMessageClass);