Kalaxia /
ScrumbanBundle
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Scrumban\Utils; |
||
| 4 | |||
| 5 | use Scrumban\Model\CardInterface; |
||
| 6 | |||
| 7 | class CardHelper |
||
| 8 | { |
||
| 9 | public static function extractValue(string $extraData): int |
||
| 10 | { |
||
| 11 | if (strtoupper($extraData{0}) !== 'V') { |
||
| 12 | return 0; |
||
| 13 | } |
||
| 14 | return (int) substr($extraData, 1, 3); |
||
| 15 | } |
||
| 16 | |||
| 17 | public static function extractEstimatedTime(string $cardTitle): int |
||
| 18 | { |
||
| 19 | return 0; |
||
| 20 | } |
||
| 21 | |||
| 22 | public static function extractSpentTime(string $cardTitle): int |
||
| 23 | { |
||
| 24 | return 0; |
||
| 25 | } |
||
| 26 | |||
| 27 | public static function extractCreationDate(string $cardId): \DateTime |
||
| 28 | { |
||
| 29 | return (new \DateTime())->setTimestamp(hexdec(substr($cardId, 0, 8))); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 30 | } |
||
| 31 | |||
| 32 | public static function isInCurrentSprint(string $status): bool |
||
| 33 | { |
||
| 34 | return in_array($status, [ |
||
| 35 | CardInterface::STATUS_TODO, |
||
| 36 | CardInterface::STATUS_IN_PROGRESS, |
||
| 37 | CardInterface::STATUS_REVIEW, |
||
| 38 | CardInterface::STATUS_TO_RELEASE |
||
| 39 | ]); |
||
| 40 | } |
||
| 41 | |||
| 42 | public static function slugify($name) |
||
| 43 | { |
||
| 44 | return str_replace(' ', '_', strtolower($name)); |
||
| 45 | } |
||
| 46 | } |