Created
September 26, 2025 08:35
-
-
Save AndriiMz/7cab36164dc5a234def4c70e314c0877 to your computer and use it in GitHub Desktop.
symfony.php
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 | |
| /** snippet 1 */ | |
| class EmailWebhookController | |
| { | |
| public function handle(Request $request, HandleEmail $handleEmail) | |
| { | |
| $handleEmail->__invoke($request->get('message'), $request->get('accountId')); | |
| return new Response('OK'); | |
| } | |
| } | |
| /** snippet 2 */ | |
| class UserNotifier | |
| { | |
| private $mailer; | |
| public function __construct() | |
| { | |
| $this->mailer = new \App\Service\Mailer(); | |
| } | |
| public function notify(string $email, string $message) | |
| { | |
| $this->mailer->send($email, 'Notification', $message); | |
| } | |
| } | |
| /** snippet 3 */ | |
| public function findExpensiveProducts($price) | |
| { | |
| return $this->getEntityManager() | |
| ->createQuery("SELECT p FROM App\Entity\Product p WHERE p.price > $price") | |
| ->getResult(); | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment