Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active May 17, 2025 23:33
Show Gist options
  • Save mcsee/e5d6cb6dab9c47560f857c3a6d5d41e7 to your computer and use it in GitHub Desktop.
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
<?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