Last active
June 15, 2022 09:46
-
-
Save nebkam/087bb66e07821cebd1b07c4316499cca to your computer and use it in GitHub Desktop.
This file contains 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 | |
// Before | |
public function showAllUsers(EntityManagerInterface $em) | |
{ | |
$users = $em->getRepository(User::class)->findAll(); | |
return $this->json($users); | |
} | |
// After | |
public function showAllUsers(UserRepository $userRepository) | |
{ | |
$users = $userRepository->findAll(); | |
return $this->json($users); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment