-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from 21TORR/task-log
- Loading branch information
Showing
8 changed files
with
84 additions
and
68 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
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 was deleted.
Oops, something went wrong.
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,31 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Torr\TaskManager\Task; | ||
|
||
use Symfony\Component\String\Slugger\AsciiSlugger; | ||
use function Symfony\Component\String\u; | ||
|
||
/** | ||
* A VO that describes a task | ||
*/ | ||
final class TaskMetaData | ||
{ | ||
/** | ||
*/ | ||
public function __construct ( | ||
public readonly string $label, | ||
public readonly ?string $group = null, | ||
public readonly ?string $uniqueTaskId = null, | ||
) {} | ||
|
||
|
||
/** | ||
* Returns a unique key for this task | ||
*/ | ||
public function getKey () : string | ||
{ | ||
$slugger = new AsciiSlugger("en"); | ||
$key = u($this->label)->lower()->toString(); | ||
return $slugger->slug($key)->toString(); | ||
} | ||
} |