Build an array dot notation

@param array  $array   Array we want to convert to dot notation array
@param string $prepend Prepend string to master key

@return array
185458
protected function arrayDot($array, $prepend = '')
    {
        $results = array();

        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $results = array_merge($results, $this->arrayDot($value, $prepend.$key.'.'));
            } else {
                $results[$prepend.$key] = $value;
            }
        }

        return $results;
    }
624441
public static function formatArray(array $array, $braces = true)
    {
        $isMultiline = self::isArrayMultiline($array);

        $array = self::prepareArrayLines($array);

        $eol = $isMultiline ? PHP_EOL : '';

        $output = implode($array, ', ' . $eol);

        if ($isMultiline) {
            // apply base indent to array elements
            $output = self::indentLines($output, self::$tabSize);
        }

        if ($braces) {
            $output = implode(['[', $output, ']'], $eol);
        } else {
            $output = $eol . $output . $eol;
        }

        return $output;
    }
84647
public static function expandDotNotationKeys(Array $array)
    {
        $result = [];

        foreach ($array as $key => $value) {
          array_set($result, $key, $value);
        }

        return $result;
    }
1192139
public function arrayToAttr(array $array = [], array $append = [], array $options = [])
    {
        $array = array_merge_recursive($array, $append);
        $attr = '';

        foreach ($array as $key => $value) {
            if (\is_array($value)) {
                $value = implode(' ', $value);
            }

            if ('title' === mb_strtolower($key)) {
                if (!isset($array['title_translate'])) {
                    $value = $this->translator->trans($value, [], $options['trans_domain'] ?? null);
                }
            }

            $attr .= sprintf('%s="%s"', $key, $value);
        }

        return $attr;
    }
524780
public static function add(&$arr, $obj, $prepend = false)
    {
        if ($prepend) {
            array_unshift($arr, $obj);
        } else {
            array_push($arr, $obj);
        }

        return $arr;
    }
76968
public static function expandFromDotNotatedKeys(array $array) {
    $data = new Data();

    // @todo Make this work at all levels of array.
    foreach ($array as $key => $value) {
      $data->set($key, $value);
    }

    return $data->export();
  }
339311
public function to_signable_string($array)
	{
		$t = array();

		foreach ($array as $k => $v)
		{
			$t[] = $this->encode_signature2($k) . '=' . $this->encode_signature2($v);
		}

		return implode('&', $t);
	}
73328
private function yamlizeArray($array, $indent)
    {
        if (is_array($array)) {
            $string = '';
            $previous_key = -1;

            foreach ($array as $key => $value) {
                if (!isset($first_key)) {
                    $first_key = $key;
                }

                $string .= $this->yamlize($key, $value, $indent, $previous_key, $first_key, $array);
                $previous_key = $key;
            }

            return $string;
        } else {
            return false;
        }
    }
368932
public static function toUnderscore(array $array = [])
    {
        $output = [];
        foreach ($array as $key => $value) {
            $key = StringUtils::toUnderscore($key);
            if (is_array($value)) {
                $value = static::toUnderscore($value);
            }
            $output[$key] = $value;
        }

        return $output;
    }
769828
private function getList($array)
    {
        $list = array();
        foreach ($array as $key => $value) {
            $list[] = !is_array($value) ? $value : $this->getList($v);
        }

        return '(' . implode(' ', $list) . ')';
    }
560706
public function addPath($path, $prepend = false)
    {
        if (is_array($path)) {
            foreach ($path as $directory) {
                $this->addPath($directory, $prepend);
            }
        } else {
            if ($prepend) {
                $this->paths = array_merge([$path], $this->paths);
            } else {
                $this->paths[] = $path;
            }
        }
    }
523009
public static function array_prepend( $array, $string, $deep = false )
    {
        if ( empty( $array ) || empty( $string ) )
        {
            return $array;
        }

        foreach ( $array as $key => $element )
        {
            if ( is_array( $element ) )
            {
                if ( $deep )
                {
                    $array[$key] = self::array_prepend( $element, $string, $deep );
                }
                else
                {
                    trigger_error( 'array_prepend: array element', E_USER_WARNING );
                }
            }
            else
            {
                $array[$key] = $string . $element;
            }
        }

        return $array;
    }
1310553
public static function prefixArray(array $array, $prefix, $separator = '_')
    {
        return array_combine(
            array_map(
                function ($key) use ($prefix, $separator) {
                    return $prefix . $separator . $key;
                },
                array_keys($array)
            ),
            $array
        );
    }
779148
protected function implode( $array )
    {
        $retString = '';
        if ( empty( $array ) )
        {
            return '';
        }
        foreach ( $array as $key => $value )
        {
            if ( is_array( $value ) )
            {
                $value = $this->implode( $value );
            }
            $retString .= $key . ' ' . $value . ' ';
        }

        return $retString;
    }
1226195
protected function arrayDot($array, $prepend = null)
    {
        if (function_exists('array_dot')) {
            return array_dot($array);
        }

        $results = [];

        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $results = array_merge($results, $this->arrayDot($value, $prepend.$key.'.'));
            } else {
                $results[$prepend.$key] = $value;
            }
        }

        return $results;
    }
518453
static function build_line($array)
    {
        if (self::$data_sep)
        {
            $line = '';
            foreach ($array as $k => $v)
            {
                $line .= $k . self::$data_sep . $v . self::$col_sep;
            }
            return rtrim($line, self::$col_sep);
        }
        else
        {
            return implode(self::$col_sep, $array);
        }
    }
1181049
public function buildAttrFromArray(array $array)
    {
        $attributes = [];

        foreach ($array as $attribute => $data) {
            if (is_array($data)) {
                $data = implode(' ', $data);
            }

            $attributes[] = $attribute . '="' . htmlspecialchars($data) . '"';
        }

        return $attributes ? ' ' . implode(' ', $attributes) : '';
    }