Created
December 6, 2021 12:37
-
-
Save franiglesias/ce05f27cd2d2be1be731dd48dceacab2 to your computer and use it in GitHub Desktop.
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 | |
| declare (strict_types=1); | |
| namespace Spec\App\Domain; | |
| use App\Domain\Task; | |
| use App\Domain\TaskDescription; | |
| use App\Domain\TaskId; | |
| class TaskExamples | |
| { | |
| public static function withData(string $id, string $description): Task | |
| { | |
| return new Task( | |
| new TaskId($id), | |
| new TaskDescription($description) | |
| ); | |
| } | |
| public static function completed(): Task | |
| { | |
| $task = self::withData('1', 'Task Description'); | |
| $task->markCompleted(); | |
| return $task; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment