private static function buildArray(array $array, Structure $structure)
    {
        $maxKeyLength   = Util::getMaxKeyLength($array);
        $maxValueLength = Util::getMaxValueLength($array);
        $drawBorders    = ($structure->getBorder()) ? true : false;
        $insertTab      = ($structure->getTab()) ? true : false;

        if ($drawBorders) {
            $firstLine = self::printBorder($structure->getBorder(), $maxKeyLength, $maxValueLength);
            if ($insertTab) {
                $firstLine = $structure->getTab() . $firstLine;
            }
        } else {
            $firstLine = '';
        }

        $lines = '';
        foreach ($array as $key => $value) {
            $lines .= self::printStructureLine($key, $value, $structure, $maxKeyLength, $maxValueLength);
        }

        $lastLine = $firstLine;
        $result   = $firstLine . $lines . $lastLine;

        return $result;
    }