@param mixed[][] $sequences

@return Sequence[]
495153
protected function _getPortableSequencesList($sequences)
    {
        $list = [];

        foreach ($sequences as $value) {
            $list[] = $this->_getPortableSequenceDefinition($value);
        }

        return $list;
    }
502186
protected function buildRequirements(array $matches)
    {
        $result = [];
        foreach ($matches as $match) {
            list($key, $regexp) = $this->splitSegment($match[3]);
            $result[$key] = $regexp . ($match[1] == '(' ? '*' : '+');
        }

        return $result;
    }
274823
protected function scanArray(array $paths)
    {
        $files         = [];
        $detections    = [];

        foreach ($paths as $path) {
            $result     = $this->scanSingle($path, $this->options);
            $paths      = array_merge($paths, $result->getPaths());
            $files      = array_merge($files, $result->getFiles());
            $detections = array_merge($detections, $result->getDetections());
        }

        return new ScanResult($paths, $files, $detections);
    }
730366
public function merge(iterable $values): Sequence
    {
        $items = $this->items->merge($values);

        return $this->duplicate($items);
    }
1354651
protected function getGenericDatabases(array $databases)
    {
        $genericDatabases = array();

        foreach ($databases as $database) {
            $genericDatabases[] = $this->getGenericDatabase($database);
        }

        return $genericDatabases;
    }
1289241
protected function sortTablesWithFKsToEnd(array $tables)
    {
        $return = [];

        while ($tables) {
            /** @var TableMigration $table */
            foreach ($tables as $key => $table) {
                // if there are no fks or the required fks are allready saved.
                if ((!$fks = $table->getForeignKeys()) || (count(array_intersect_key($return, $fks)) === count($fks))) {
                    $return[$table->getName()] = $table;
                    unset($tables[$key]);
                } // if
            } // foreach
        } // while

        return $return;
    }
758967
public function setSequences(array $sequences)
    {
        $this->sequences = array();

        foreach ($sequences as $sequence) {
            $this->addSequence($sequence);
        }
    }
725070
private function normalizeTransforms($transforms): array
    {
        $r = [];

        foreach ($transforms as $t) {
            $r[] = $this->normalizeTransform((array)$t);
        }

        return $r;
    }
1089354
public function arrayReverse(array $Plots)
    {
        $Result = [];

        for ($i = count($Plots) - 1; $i >= 0; $i = $i - 2) {
            $Result[] = $Plots[$i - 1];
            $Result[] = $Plots[$i];
        }

        return $Result;
    }
988507
public function controllers(array $controllers)
    {
        $group = new Group;
        foreach ($controllers as $controller)
            $group->set($this->controller($controller));
        return $group;
    }
600006
public void setImportSequences(String[] sequences) {
        for (String s : sequences) {
            s = s.trim();
            if (s.length() > 0) {
                String[] ts = s.split("\\s+");
                List<String> sequence = new ArrayList<String>();
                for (String t : ts) {
                    t = t.trim();
                    if (t.length() > 0) {
                        sequence.add(t);
                    }
                }
                this.importSequences.add(new StringSequence(sequence));
            }
        }
    }
538895
public function getTextFromArray(array $keys = [])
    {
        $values = [];
        foreach ($keys as $key) {
            $values[$key] = $this->getText($key);
        }
        return $values;
    }
979343
public function getRepositories(
        array $domains = [],
        array $languages = []
    ) : array {
        $repositories = array_filter(
            $this->repositories,
            function (Repository $repository) use ($domains) {
                return
                    empty($domains) ||
                    in_array($repository->getDomain(), $domains);
            }
        );

        return array_filter(
            $repositories,
            function (Repository $repository) use ($languages) {
                return
                    empty($languages) ||
                    in_array($repository->getLanguage(), $languages);
            }
        );
    }
583796
public static function multiToAssoc(array $arrays)
    {
        $results = [];
        foreach ($arrays as $key => $value) {
            if (self::isReallyArray($value) === true) {
                $results = array_merge($results, self::multiToAssoc($value));
            } else {
                $results[$key] = $value;
            }
        }

        return $results;
    }
721282
public static function flatten (array $sequence)
    {
        $flat = array();
        array_walk_recursive($sequence, function ($element) use (&$flat) { $flat []= $element; });
        return $flat;
    }
917746
protected function getUnsequencedClasses(array $sequences, array $classes = null)
    {
        $unsequencedClasses = array();

        if (is_null($classes)) {
            $classes = array_keys($sequences);
        }

        foreach ($classes as $class) {
            // might not be set if depends on ordered fixture
            if (isset($sequences[$class]) && $sequences[$class] === -1) {
                $unsequencedClasses[] = $class;
            }
        }

        return $unsequencedClasses;
    }
1093076
public function many(array $keys)
    {
        $return = [];

        $prefixedKeys = array_map(function ($key) {
            return $this->prefix . $key;
        }, $keys);

        $values = $this->connection()->mGet($prefixedKeys);

        foreach ($values as $index => $value) {
            $return[$keys[$index]] = is_numeric($value) ? $value : unserialize($value);
        }

        return $return;
    }