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 |
||||
|
0 ignored issues
–
show
|
|||||
| 18 | { |
||||
| 19 | return 0; |
||||
| 20 | } |
||||
| 21 | |||||
| 22 | public static function extractSpentTime(string $cardTitle): int |
||||
|
0 ignored issues
–
show
The parameter
$cardTitle is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
|
|||||
| 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
It seems like
hexdec(substr($cardId, 0, 8)) can also be of type double; however, parameter $unixtimestamp of DateTime::setTimestamp() does only seem to accept integer, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
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 | } |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.