protected function convert(Matrix $mA)
    {
        //get largest value length as a string
        $padLen = 0;
        /** @noinspection PhpUnusedParameterInspection */
        /** @noinspection PhpDocSignatureInspection */
        /** @noinspection PhpDocSignatureInspection */
        $fGetLen = function($row, $col, $value) use(&$padLen) {
            if (is_bool($value)) {
                $value = ($value ? 1 : 0);
            }
            $l = strlen((string) $value);
            if ($l > $padLen) {
                $padLen = $l;
            }
            return $value;
        };
        $mA("MFunction", $fGetLen);

        //pad out each value
        $padLen += $this->options['padLine'];
        $padString = $this->options['padString'];
        $padType = $this->options['padType'];
        /** @noinspection PhpUnusedParameterInspection */
        /** @noinspection PhpDocSignatureInspection */
        /** @noinspection PhpDocSignatureInspection */
        $fConvert = function($row, $col, $value) use ($padLen, $padString, $padType) {
            if (is_bool($value)) {
                $value = ($value ? 1 : 0);
            }
            return str_pad($value, $padLen, $padString, $padType);
        };

        $mC = $mA("MFunction", $fConvert);

        return $mC;
    }
protected function convert(Matrix $mA)
    {
        //get largest value length as a string
        $padLen = 0;
        /** @noinspection PhpUnusedParameterInspection */
        /** @noinspection PhpDocSignatureInspection */
        /** @noinspection PhpDocSignatureInspection */
        $fGetLen = function($row, $col, $value) use(&$padLen) {
            if (is_bool($value)) {
                $value = ($value ? 1 : 0);
            }
            $l = strlen((string) $value);
            if ($l > $padLen) {
                $padLen = $l;
            }
            return $value;
        };
        $mA("MFunction", $fGetLen);

        //pad out each value
        $padLen += $this->options['padLine'];
        $padString = $this->options['padString'];
        $padType = $this->options['padType'];
        /** @noinspection PhpUnusedParameterInspection */
        /** @noinspection PhpDocSignatureInspection */
        /** @noinspection PhpDocSignatureInspection */
        $fConvert = function($row, $col, $value) use ($padLen, $padString, $padType) {
            if (is_bool($value)) {
                $value = ($value ? 1 : 0);
            }
            return str_pad($value, $padLen, $padString, $padType);
        };

        $mC = $mA("MFunction", $fConvert);

        return $mC;
    }
protected function convert ( Matrix $ mA ) { //get largest value length as a string $ padLen = 0 ; /** @noinspection PhpUnusedParameterInspection */ /** @noinspection PhpDocSignatureInspection */ /** @noinspection PhpDocSignatureInspection */ $ fGetLen = function ( $ row , $ col , $ value ) use ( & $ padLen ) { if ( is_bool ( $ value ) ) { $ value = ( $ value ? 1 : 0 ) ; } $ l = strlen ( ( string ) $ value ) ; if ( $ l > $ padLen ) { $ padLen = $ l ; } return $ value ; } ; $ mA ( "MFunction" , $ fGetLen ) ; //pad out each value $ padLen += $ this -> options [ 'padLine' ] ; $ padString = $ this -> options [ 'padString' ] ; $ padType = $ this -> options [ 'padType' ] ; /** @noinspection PhpUnusedParameterInspection */ /** @noinspection PhpDocSignatureInspection */ /** @noinspection PhpDocSignatureInspection */ $ fConvert = function ( $ row , $ col , $ value ) use ( $ padLen , $ padString , $ padType ) { if ( is_bool ( $ value ) ) { $ value = ( $ value ? 1 : 0 ) ; } return str_pad ( $ value , $ padLen , $ padString , $ padType ) ; } ; $ mC = $ mA ( "MFunction" , $ fConvert ) ; return $ mC ; }
Create a matrix with padded string values

@param \Chippyash\Matrix\Matrix $mA
@return \Chippyash\Matrix\Matrix
Create a matrix with padded string values