| 1 | <?php |
||
| 21 | class TaskFactory |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * TaskRepository |
||
| 25 | * |
||
| 26 | * @var TaskRepositoryInterface |
||
| 27 | */ |
||
| 28 | protected $taskRepository; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * TaskFactory constructor |
||
| 32 | * |
||
| 33 | * @param TaskRepositoryInterface $taskRepository |
||
| 34 | * |
||
| 35 | */ |
||
| 36 | public function __construct(TaskRepositoryInterface $taskRepository) |
||
| 40 | |||
| 41 | |||
| 42 | /** |
||
| 43 | * Create Task From Name |
||
| 44 | * |
||
| 45 | * @param string $name Name |
||
| 46 | * |
||
| 47 | * @return Task |
||
| 48 | * @throws TaskNameIsAlreadyExistedException |
||
| 49 | * @throws TaskNameIsEmptyException |
||
| 50 | */ |
||
| 51 | public function createFromName(string $name) : Task |
||
| 73 | |||
| 74 | |||
| 75 | } |
||
| 76 |