Last active
September 6, 2023 02:39
-
-
Save mcsee/36f0af6785ea36a05c3ec394fa71e4e8 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
<? | |
final class BookItem { | |
function numberOfPages() { } | |
function language(): Language { } | |
function book(): Book { } | |
function edition(): BookEdition { } | |
// Loan and overdues are not book items responsibility | |
} | |
final class LoanTracker { | |
function loan( | |
BookItem $bookCopy, | |
LibraryUser $reader, | |
DatePeriod $loanDates) { | |
// DatePeriod is better than anemic $fromDate and $toDate | |
} | |
} | |
final class LoanTrackerTests extends TestCase { | |
// Lots of maintained tests telling you how the system really works | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment