get('doctrine')->getRepository(SmallOverload1::class)->findAll(); $this ->writeSession($session) ->readSession($session) ->log() ->fireEvent() ->validate($entities); return $this->render( '@SmallOverload/SmallOverload/smallOverload.html.twig', ['smallOverloads' => $entities] ); } /** @return $this */ protected function writeSession(SessionInterface $session) { for ($x = 1; $x <= 10; $x++) { $session->set('overload-' . $x, 'overload-' . $x . '-value'); } return $this; } /** @return $this */ protected function readSession(SessionInterface $session) { for ($x = 1; $x <= 20; $x++) { $session->get('overload-' . $x, 'overload-' . $x . '-value-not-found'); } return $this; } /** @return $this */ protected function log() { for ($x = 1; $x <= 10; $x++) { // $logger->notice('[Session ' . $session->getId() . '] Small overload message ' . $x); } return $this; } /** @return $this */ protected function fireEvent() { $event = new Event(); $this->get('event_dispatcher')->dispatch('phpbenchmarks.smallOverload', $event); return $this; } /** @return $this */ protected function validate(array $entities) { $validator = $this->get('validator'); for ($x = 0; $x < 10; $x++) { $violations = $validator->validate($entities[$x], null, 'smallOverload'); if (count($violations) > 0) { throw new HttpException(500, 'Validation error'); } } return $this; } }