protected static function formatDigitable(
        $bank_code,
        $currency_code,
        $check_digit,
        $due_factor,
        $value,
        $free_space
    ) {
        $fields = [];

        /*
         * Field #0
         *
         * - $bank_code
         * - $currency_code
         * - 5 first digits from $free_space
         * - Check digit for this field
         */
        $tmp = $bank_code . $currency_code . substr($free_space, 0, 5);
        $tmp .= Utils\Validation::mod10($tmp);
        $fields[] = implode('.', str_split($tmp, 5));

        /*
         * Field #1
         *
         * - Digits 6 to 15 from $free_space
         * - Check digit for this field
         */
        $tmp = substr($free_space, 5, 10);
        $fields[] = implode('.', str_split($tmp, 5))
            . Utils\Validation::mod10($tmp);

        /*
         * Field #2
         *
         * - Digits 16 to 25 from $free_space
         * - Check digit for this field
         */
        $tmp = substr($free_space, 15, 10);
        $fields[] = implode('.', str_split($tmp, 5))
            . Utils\Validation::mod10($tmp);

        /*
         * Field #3
         *
         * - Digitable line $check_digit
         */
        $fields[] = $check_digit;

        /*
         * Field #4
         *
         * - $due_factor
         * - Document $value
         */
        $fields[] = $due_factor . $value;

        return implode(' ', $fields);
    }
protected static function formatDigitable(
        $bank_code,
        $currency_code,
        $check_digit,
        $due_factor,
        $value,
        $free_space
    ) {
        $fields = [];

        /*
         * Field #0
         *
         * - $bank_code
         * - $currency_code
         * - 5 first digits from $free_space
         * - Check digit for this field
         */
        $tmp = $bank_code . $currency_code . substr($free_space, 0, 5);
        $tmp .= Utils\Validation::mod10($tmp);
        $fields[] = implode('.', str_split($tmp, 5));

        /*
         * Field #1
         *
         * - Digits 6 to 15 from $free_space
         * - Check digit for this field
         */
        $tmp = substr($free_space, 5, 10);
        $fields[] = implode('.', str_split($tmp, 5))
            . Utils\Validation::mod10($tmp);

        /*
         * Field #2
         *
         * - Digits 16 to 25 from $free_space
         * - Check digit for this field
         */
        $tmp = substr($free_space, 15, 10);
        $fields[] = implode('.', str_split($tmp, 5))
            . Utils\Validation::mod10($tmp);

        /*
         * Field #3
         *
         * - Digitable line $check_digit
         */
        $fields[] = $check_digit;

        /*
         * Field #4
         *
         * - $due_factor
         * - Document $value
         */
        $fields[] = $due_factor . $value;

        return implode(' ', $fields);
    }
protected static function formatDigitable ( $ bank_code , $ currency_code , $ check_digit , $ due_factor , $ value , $ free_space ) { $ fields = [ ] ; /*
         * Field #0
         *
         * - $bank_code
         * - $currency_code
         * - 5 first digits from $free_space
         * - Check digit for this field
         */ $ tmp = $ bank_code . $ currency_code . substr ( $ free_space , 0 , 5 ) ; $ tmp .= Utils \ Validation :: mod10 ( $ tmp ) ; $ fields [ ] = implode ( '.' , str_split ( $ tmp , 5 ) ) ; /*
         * Field #1
         *
         * - Digits 6 to 15 from $free_space
         * - Check digit for this field
         */ $ tmp = substr ( $ free_space , 5 , 10 ) ; $ fields [ ] = implode ( '.' , str_split ( $ tmp , 5 ) ) . Utils \ Validation :: mod10 ( $ tmp ) ; /*
         * Field #2
         *
         * - Digits 16 to 25 from $free_space
         * - Check digit for this field
         */ $ tmp = substr ( $ free_space , 15 , 10 ) ; $ fields [ ] = implode ( '.' , str_split ( $ tmp , 5 ) ) . Utils \ Validation :: mod10 ( $ tmp ) ; /*
         * Field #3
         *
         * - Digitable line $check_digit
         */ $ fields [ ] = $ check_digit ; /*
         * Field #4
         *
         * - $due_factor
         * - Document $value
         */ $ fields [ ] = $ due_factor . $ value ; return implode ( ' ' , $ fields ) ; }
Formats the barcode into a Digitable line

@param string $bank   Bank code (3 digits)
@param string $currency Currency Code (1 digit)
@param string $cd     Check digit (1 digit)
@param string $due    Due Factor (4 digits)
@param string $value  Document Value (10 digits: 8 integers and 2 decimals)
@param string $free   Free space (25 digits, defined by each bank)
@return string
Formats the barcode into a Digitable line