Created
December 13, 2025 22:48
-
-
Save mcsee/65956b492933a751f412d955899f6365 to your computer and use it in GitHub Desktop.
This gist belongs to Clean Code Cookbook http://cleancodecookbook.com By Maximiliano Contieri http://maximilianocontieri.com
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 | |
| final class UserRepository { | |
| private Database $database; | |
| public function __construct(Database $database) { | |
| $this->database = $database; | |
| } | |
| public function find(UserId $id): User { | |
| return $this->database->fetchUser($id); | |
| } | |
| } | |
| // You removed credentials, SQL, and infrastructure noise. | |
| // Now reviewers can discuss design and behavior. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment