-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move responsibility for key injection out of Registrar into CommentRe…
…gistrar
- Loading branch information
Showing
8 changed files
with
111 additions
and
25 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Aeliot\TodoRegistrar\Dto\Registrar; | ||
|
||
class Todo | ||
{ | ||
public function __construct( | ||
private string $tag, | ||
private string $summary, | ||
private string $description, | ||
private ?string $assignee, | ||
) { | ||
} | ||
|
||
public function getAssignee(): ?string | ||
{ | ||
return $this->assignee; | ||
} | ||
|
||
public function getDescription(): string | ||
{ | ||
return $this->description; | ||
} | ||
|
||
public function getSummary(): string | ||
{ | ||
return $this->summary; | ||
} | ||
|
||
public function getTag(): string | ||
{ | ||
return $this->tag; | ||
} | ||
} |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Aeliot\TodoRegistrar\Service; | ||
|
||
use Aeliot\TodoRegistrar\Dto\Comment\CommentPart; | ||
use Aeliot\TodoRegistrar\Dto\Registrar\Todo; | ||
|
||
class TodoFactory | ||
{ | ||
public function create(CommentPart $commentPart): Todo | ||
{ | ||
return new Todo( | ||
$commentPart->getTag(), | ||
$commentPart->getFirstLine(), | ||
$commentPart->getContent(), | ||
$commentPart->getTagMetadata()?->getAssignee(), | ||
); | ||
} | ||
} |
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