@param array $psr

@return array
184166
protected function getPsrPaths(array $psr)
    {
        $paths = [];
        foreach ($psr as $item) {
            if (is_array($item)) {
                $paths = array_merge($paths, $item);
            } else {
                $paths[] = $item;
            }
        }

        return $paths;
    }
788100
protected function _flattenCookiesArray($ptr, $ret_as = self::COOKIE_OBJECT) {
        if (is_array($ptr)) {
            $ret = ($ret_as == self::COOKIE_STRING_CONCAT || $ret_as == self::COOKIE_STRING_CONCAT_STRICT) ? '' : array();
            foreach ($ptr as $item) {
                if ($ret_as == self::COOKIE_STRING_CONCAT_STRICT) {
                    $postfix_combine = (!is_array($item) ? ' ' : '');
                    $ret .= $this->_flattenCookiesArray($item, $ret_as) . $postfix_combine;
                } elseif ($ret_as == self::COOKIE_STRING_CONCAT) {
                    $ret .= $this->_flattenCookiesArray($item, $ret_as);
                } else {
                    $ret = array_merge($ret, $this->_flattenCookiesArray($item, $ret_as));
                }
            }
            return $ret;
        } elseif ($ptr instanceof Zend_Http_Cookie) {
            switch ($ret_as) {
                case self::COOKIE_STRING_ARRAY:
                    return array($ptr->__toString());
                    break;

                case self::COOKIE_STRING_CONCAT_STRICT:
                    // break intentionally omitted

                case self::COOKIE_STRING_CONCAT:
                    return $ptr->__toString();
                    break;

                case self::COOKIE_OBJECT:
                default:
                    return array($ptr);
                    break;
            }
        }

        return null;
    }
511406
public function format(array $record)
    {
        $formattedRecord = $this->formatter->format($record);

        if (is_array($formattedRecord)) {
            list($channel, $message, $backtrace, $loglevel) = $formattedRecord;

            return [
                $channel,
                $this->formatterPrefix . $message,
                $backtrace,
                $loglevel,
            ];
        }

        return $this->formatterPrefix . $formattedRecord;
    }
1221527
protected function packResult($rs)
    {
        return [
            'id' => $this->id,
            'module' => $this->module,
            'fun' => $this->fun,
            'args' => $this->args,
            'return' => isset($rs['return']) ? $rs['return'] : null,
            'status' => isset($rs['status']) ? $rs['status'] : 200,
            'output' => isset($rs['output']) ? $rs['output'] : '',
            'exception' => isset($rs['exception']) ? $rs['exception'] : [],
        ];
    }
1201531
public static function ls($dir): array
    {
        $contents = [];

        $flags = \FilesystemIterator::KEY_AS_PATHNAME
            | \FilesystemIterator::CURRENT_AS_FILEINFO
            | \FilesystemIterator::SKIP_DOTS;

        $dirIterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir, $flags));

        foreach ($dirIterator as $path => $fi) {
            $contents[] = $path;
        }

        natsort($contents);
        return $contents;
    }
231441
private function configure(array $options = []): array
    {
        $resolver = new OptionsResolver();
        $resolver->setDefaults([
            'max_restarts' => 10,
        ]);

        $resolver->setAllowedTypes('max_restarts', 'int');

        return $resolver->resolve($options);
    }
782431
public static function flatten($arr) {
		if(!is_array($arr))
			return [$arr];
		$res = [];
		foreach($arr as $k=>$v) {
			if(is_array($v))
				$res = array_merge($res, static::flatten($v));
			else
				$res[] = $v;
		}
		return $res;
	}
402582
protected function to2DArray($arr)
    {
        if (empty($arr) || !is_array($arr)) {
            return [];
        }
        if (count($arr) == count($arr, COUNT_RECURSIVE)) {
            return [$arr];
        }
        return $arr;
    }
891875
function Next($rs)
	{
		$this->RequireConnection();
		
		$this->handler->Log(DBH_LOG_DEBUG, "Fetching next result as array");
		return $this->adapter->Fetch($rs);

	}
784847
public function getMigrations(Updater $updater)
    {
        $optionTable = Common::prefixTable('option');
        $removeEmptyDefaultReportsSql = "delete from `$optionTable` where option_name like '%defaultReport%' and option_value=''";

        return array(
            $this->migration->db->sql($removeEmptyDefaultReportsSql)
        );
    }
1156591
public static function createArray(array $addresses): array
    {
        $addrs = [];
        foreach ($addresses as $address) {
            $addrs[] = self::create($address);
        }

        return $addrs;
    }
288042
private static function getAllRemaining(\ArrayIterator $iterator): array
    {
        $values = [];
        while ($iterator->valid()) {
            $values[] = $iterator->current();
            $iterator->next();
        }

        return $values;
    }
745616
public static function flatten(array $arr): array
    {
        $i = 0;
        $len = count($arr);
        for (; $i<$len; $i++) {
            if (is_array($arr[$i])) {
                array_splice($arr, $i, 1, $arr[$i]);
                $len--;
            }
        }
        return $arr;
    }
155482
public static function getAutoloadNamespaces2() {
		// FIXME: adapt this to PSR-4!
		$composer = json_decode(file_get_contents(__DIR__."/../../../../../composer.json"), true);
		
		$psr = isset($composer["autoload"]["psr-0"]) ? "0" : (isset($composer["autoload"]["psr-4"]) ? "4" : null);
		if ($psr !== null) {
			$autoload = $composer["autoload"]["psr-$psr"];
		}
		else {
			return null;
		}
		
		if (self::isAssoc($autoload)) {
			$ret = self::unfactorizeAutoload(array($autoload));
		} else {
			$ret = self::unfactorizeAutoload($autoload);
		}
		
		$ret['psr'] = $psr;
		
		return $ret;
	}
510647
public static function parse(array $arr, ...$args) {
        $schema = new static([], ...$args);
        $schema->schema = $schema->parseInternal($arr);
        return $schema;
    }
8685
public function psr4()
    {
        $i = $this->load($this->composerPath . $this->psrFourName);

        if ($i !== false) {
            $this->log[] = 'Imported ' . $i . ' classes from psr4';
            return $i;
        }

        $this->log[] = 'Warn: psr4 not found';
        return false;
    }
791472
public function collectAliases(): array
    {
        $aliases = array_merge(
            $this->prepareAliases('psr-0'),
            $this->prepareAliases('psr-4')
        );
        if ($this->isRoot()) {
            $aliases = array_merge($aliases,
                $this->prepareAliases('psr-0', true),
                $this->prepareAliases('psr-4', true)
            );
        }

        return $aliases;
    }