App\Console\Commands\XeInstall::encodeArr2Str PHP Method

encodeArr2Str() private method

encodeArr2Str
private encodeArr2Str ( array $arr, integer $depth ) : string
$arr array
$depth integer
return string
    private function encodeArr2Str(array $arr, $depth = 0)
    {
        $output = '';
        foreach ($arr as $key => $val) {
            if (is_array($val)) {
                $output .= $this->getIndent($depth) . "'{$key}' => " . '[' . PHP_EOL . $this->encodeArr2Str($val, $depth + 1) . $this->getIndent($depth) . '],' . PHP_EOL;
            } else {
                if (is_bool($val)) {
                    $val = $val ? 'true' : 'false';
                } elseif (!is_int($val)) {
                    $val = "'{$val}'";
                }
                $output .= $this->getIndent($depth) . "'{$key}' => " . $val . ',' . PHP_EOL;
            }
        }
        return $output;
    }