Symfony\Component\Form\TimeField::generatePaddedChoices PHP Method

generatePaddedChoices() protected method

If the values are shorter than $padLength characters, they are padded with zeros on the left side.
protected generatePaddedChoices ( array $values, integer $padLength ) : array
$values array The available choices
$padLength integer The length to pad the choices
return array An array with the input values as keys and the padded values as values
    protected function generatePaddedChoices(array $values, $padLength)
    {
        $choices = array();

        foreach ($values as $value) {
            $choices[$value] = str_pad($value, $padLength, '0', STR_PAD_LEFT);
        }

        return $choices;
    }