Last active
May 17, 2025 23:33
-
-
Save mcsee/e5d6cb6dab9c47560f857c3a6d5d41e7 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 | |
class Invoice { | |
public int $id; | |
// The external identifier is never an essential | |
// responsibilty for an object | |
public string $customerName; | |
public array $items; | |
public function __construct( | |
int $id, string $customerName, array $items) { | |
$this->id = $id; | |
$this->customerName = $customerName; | |
$this->items = $items; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment