This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //vendor/symfony/http-kernel/HttpKernel.php | |
| <?php | |
| //... | |
| // controller arguments | |
| $arguments = $this->argumentResolver->getArguments($request, $controller); | |
| $event = new ControllerArgumentsEvent($this, $controller, $arguments, $request, $type); | |
| $this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS); | |
| $controller = $event->getController(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Controller; | |
| use App\Entity\Post; | |
| use App\Review; | |
| use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | |
| use Symfony\Component\HttpFoundation\Request; | |
| use Symfony\Component\HttpFoundation\Response; | |
| use Symfony\Component\Routing\Annotation\Route; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //vendor/symfony/http-kernel/HttpKernel.php | |
| <?php | |
| private function handleRaw(Request $request, int $type = self::MASTER_REQUEST): Response | |
| { | |
| //...previous stages | |
| // call controller | |
| $response = $controller(...$arguments); | |
| // view |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //public/index.php | |
| $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']); | |
| $request = Request::createFromGlobals(); | |
| $response = $kernel->handle($request); | |
| $response->send(); | |
| $kernel->terminate($request, $response); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //vendor/symfony/http-kernel/HttpKernel.php | |
| <?php | |
| //... | |
| $this->requestStack->push($request); | |
| // request | |
| $event = new RequestEvent($this, $request, $type); | |
| $this->dispatcher->dispatch($event, KernelEvents::REQUEST); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //... | |
| // load controller | |
| if (false === $controller = $this->resolver->getController($request)) { | |
| throw new NotFoundHttpException(sprintf('Unable to find the controller for path "%s". The route is wrongly configured.', $request->getPathInfo())); | |
| } | |
| $event = new ControllerEvent($this, $controller, $request, $type); | |
| $this->dispatcher->dispatch($event, KernelEvents::CONTROLLER); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // src/Lucky.php | |
| namespace App; | |
| class Lucky | |
| { | |
| public function getNumber() | |
| { | |
| return random_int(1,100); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // src/Controller/DefaultController.php | |
| namespace App\Controller; | |
| use App\Lucky; | |
| use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | |
| use Symfony\Component\Routing\Annotation\Route; | |
| class DefaultController extends AbstractController |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This file is the entry point to configure your own services. | |
| # Files in the packages/ subdirectory configure your dependencies. | |
| # Put parameters here that don't need to change on each machine where the app is deployed | |
| # https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration | |
| parameters: | |
| services: | |
| # default configuration for services in *this* file | |
| _defaults: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Entity; | |
| use App\Repository\CustomerRepository; | |
| use Doctrine\ORM\Mapping as ORM; | |
| /** | |
| * @ORM\Entity(repositoryClass=CustomerRepository::class) | |
| */ |