Skip to content

Instantly share code, notes, and snippets.

@franiglesias
Created December 6, 2021 12:37
Show Gist options
  • Select an option

  • Save franiglesias/ce05f27cd2d2be1be731dd48dceacab2 to your computer and use it in GitHub Desktop.

Select an option

Save franiglesias/ce05f27cd2d2be1be731dd48dceacab2 to your computer and use it in GitHub Desktop.
<?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