Flattens start-, middle-, end-, before- and afterKeys to a single dimension and merges them together to a single array

@return array
176106
protected function generateSortedKeysMap(): array
    {
        $sortedKeysMap = [];

        $startKeys = $this->startKeys;
        $middleKeys = $this->middleKeys;
        $endKeys = $this->endKeys;
        $beforeKeys = $this->beforeKeys;
        $afterKeys = $this->afterKeys;
        $flattenFunction = function ($value, $key, $step) use (&$sortedKeysMap, &$beforeKeys, &$afterKeys, &$flattenFunction) {
            if (isset($beforeKeys[$value])) {
                array_walk_recursive($beforeKeys[$value], $flattenFunction, $step);
                unset($beforeKeys[$value]);
            }
            $sortedKeysMap[$step][] = $value;
            if (isset($afterKeys[$value])) {
                array_walk_recursive($afterKeys[$value], $flattenFunction, $step);
                unset($afterKeys[$value]);
            }
        };

        // 1st step: collect regular keys and process before / after if keys occurred
        array_walk_recursive($startKeys, $flattenFunction, 0);
        array_walk_recursive($middleKeys, $flattenFunction, 2);
        array_walk_recursive($endKeys, $flattenFunction, 4);

        // 2nd step: process before / after leftovers for unmatched keys
        array_walk_recursive($beforeKeys, $flattenFunction, 1);
        array_walk_recursive($afterKeys, $flattenFunction, 3);

        ksort($sortedKeysMap);
        return $sortedKeysMap;
    }
911613
public function getPrimaryKeyList()
    {
        $ids = [];
        if (count($this) > 0) {
            foreach ($this as $row) {
                $ids[] = $row->getPrimaryKeyValue();
            }
        }
        return $ids;
    }
349927
public function getKeyValuePair() {
        $result = array();

        foreach ($this->items as $key => $entry) {
            $result[$key] = $entry->value;
        }

        return $result;
    }
1237449
public function toArray()
    {
        $result = [];

        if (!empty($this->value)) {
            if (!empty($this->details)) {
                $parts = explode('.', $this->value);
                $result['value'] = join('.', array_slice($parts, 0, $this->details));
            } else {
                $result['value'] = $this->value;
            }
        }

        if (!empty($this->alias)) {
            $result['alias'] = $this->alias;
        }

        if (!empty($this->nickname)) {
            $result['nickname'] = $this->nickname;
        }

        if (isset($result['value']) && !isset($result['alias']) && !isset($result['nickname'])) {
            return $result['value'];
        }

        return $result;
    }
197171
public static function getAllIniPartCacheSubKeys() : array
    {
        $subKeys = [];
        $chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];

        foreach ($chars as $charOne) {
            foreach ($chars as $charTwo) {
                foreach ($chars as $charThree) {
                    $subKeys[] = $charOne . $charTwo . $charThree;
                }
            }
        }

        return $subKeys;
    }
330642
public static function merge(): array
    {
        $args = func_get_args();
        $array = array_shift($args);

        while (! empty($args)) {
            $next = array_shift($args);

            foreach ($next as $key => $value) {
                if (is_int($key)) {
                    if (isset($array[$key])) {
                        $array[] = $value;
                    } else {
                        $array[$key] = $value;
                    }
                } elseif (is_array($value) && isset($array[$key]) && is_array($array[$key])) {
                    $array[$key] = static::merge($array[$key], $value);
                } else {
                    $array[$key] = $value;
                }
            }
        }

        return $array;
    }
628112
protected function getPrimaryKey(): array
    {
        $primary = array_flip($this->getTable()->getPrimaryKey());

        return array_intersect_key($this->toArray(), $primary);
    }
831787
protected function getKeyAsArray()
    {
        $result = [];
        if ( ! empty( $this->compositeKey )) {
            foreach ($this->compositeKey as $key) {
                $result[$key] = $this->{$key};
            }
        } else {
            $result[$this->getKeyName()] = $this->getKey();
        }

        return $result;
    }
402265
public function toArray()
    {
        $keys = $this->redis->hKeys($this->key);
        $result = array();
        foreach ($keys as $key) {
            $result[$key] = $this->offsetGet($key);
        }
        return $result;
    }
205629
public function getFullDataSet () : array
    {
        if ($this->isUsingHandler()) :
            $this->regularize();
            $this->clearCache();

            return $this->_Cache = $this->_DataHandler->selectRangeEntitys(0,$this->_maxKey + 1);
        else :
            return $this->_Container;
        endif;
    }
1148103
protected function getPossibleKeys()
	{
		$keys = [];
		foreach (range('a', 'z') as $char)
		{
			$keys[] = $this->keyPrefix . $char;
		}

		return $keys;
	}
50187
private function normalize() : array {
    $files = [];

    foreach($_FILES as $key => $file) {
      
      if (!is_array($file['name'])) {
          $files[$key][] = $file;
          continue;
      }

      foreach($file['name'] as $subKey => $name) {
          $files[$key][$subKey] = [
              'name' => $name,
              'type' => $file['type'][$subKey],
              'tmp_name' => $file['tmp_name'][$subKey],
              'error' => $file['error'][$subKey],
              'size' => $file['size'][$subKey]
          ];
      }
    }

    return $files;
  }
612778
public function split()
    {
        return [
            'outward'     => $this->outward(),
            'inward'      => $this->inward(),
            'area'        => $this->area(),
            'district'    => $this->district(),
            'subdistrict' => $this->subdistrict(),
            'sector'      => $this->sector(),
            'unit'        => $this->unit(),
            'normalise'   => $this->normalise(),
        ];
    }
157857
public function toArray()
    {
        return [
            [
                'endpoint' => $this->endpoint->toArray(),
                'timestamp' => $this->startTimestamp,
                'value' => $this->values[0]
            ],
            [
                'endpoint' => $this->endpoint->toArray(),
                'timestamp' => $this->endTimestamp,
                'value' => $this->values[1]
            ]
        ];
    }
1235267
public function getLastLevelOfdataTypes()
    {
        $dataTypes = $this->getDataTypes();
        $lastLevel = array();
        foreach ($dataTypes as $key1 => $value1) {
            if (! array_key_exists('children', $value1))
                $lastLevel[$key1] = $value1;
            else
                foreach ($value1['children'] as $key2 => $value2)
                    $lastLevel[$key2] = $value2;
        }
        return $lastLevel;
    }
99880
public function getAllKeys() {
		$all_messages = array();

		// First, let's merge all the arrays in order to get all the keys:
		foreach ($this->messages as $language=>$message) {
			$all_messages = array_merge($all_messages, $message->getAllMessages());
		}

		return array_keys($all_messages);
	}
303427
public function toArray()
    {
        $array = [];
        $transform = function ($letters) {
            $letter = array_shift($letters);

            return '_' . strtolower($letter);
        };
        foreach ($this as $key => $value) {
            if ($key === '__strictMode__') {
                continue;
            }
            $normalizedKey = preg_replace_callback('/([A-Z])/', $transform, $key);
            $array[$normalizedKey] = $value;
        }

        return $array;
    }