Get all/key-matching packages

@param   null|string|array   $key
@return  string
505823
public function getPackages( $keys = null )
    {
        $packages = array();

        if ( empty( $keys ) )
        {
            foreach ( $this as $subPackages )
            {
                $packages = array_merge(
                    $packages,
                    array_values( $subPackages )
                );
            }
        }
        else if ( is_array( $keys ) )
        {
            foreach ( $keys as $key )
            {
                $key = (string) $key;

                if ( ! empty( $this[$key] ) )
                {
                    $packages = array_merge(
                        $packages,
                        array_values( $this[$key] )
                    );
                }
            }
        }
        else
        {
            $packages = $this[(string) $keys];
        }

        return array_unique( array_map( 'strtolower', $packages ) );
    }
366766
protected function flashGet( $key ) {
		if ( isset( $this->slim->environment['slim.flash'] ) ) {
			return $this->slim->environment['slim.flash'][$key];
		} else {
			return null;
		}
	}
1267474
protected function mapper(string $key)
    {
        $character = $this->getOption('character');
        $config = config('mentions.pools.' . $this->getOption('pool'));

        $mention = str_replace($character, '', trim($key));

        $mentionned = $config['model']::whereRaw("LOWER({$config['column']}) = ?", [Str::lower($mention)])->first();

        if ($mentionned == false) {
            return null;
        }

        if ($this->getOption('mention') == true && $mentionned->getKey() !== Auth::id()) {
            $this->model->mention($mentionned, $this->getOption('notify'));
        }

        return '/' . preg_quote($key) . '(?!\w)/';
    }
453910
public function hGetAll($key) {
        return $this->send(['hgetall', $key], function ($response) {
            if ($response === null) {
                return null;
            }

            $size = \count($response);
            $result = [];

            for ($i = 0; $i < $size; $i += 2) {
                $result[$response[$i]] = $response[$i + 1];
            }

            return $result;
        });
    }
509847
public function getExtensionsByPackage($key, $packageName) {
		if ($this->packages->has($packageName)) {
			$pkg = $this->packages->get($packageName);
			if ($pkg->has($key)) {
				return $pkg->get($key);
			}
		}
		
		return [];
	}
395500
public function files(...$key)
    {
        $files = $this->files;
        while ($key) {
            $files = $files[array_shift($key)] ?? null;
        }

        return $files;
    }
966751
protected function getValuesFromKeyMap( $key )
    {
        if ( empty( $key ) || empty( $this->keyMap[$key] ) )
        {
            return null;
        }

        return $this->keyMap[$key];
    }
22546
protected function getConditionsFromKey($key)
    {
        if (is_int($key) || ctype_digit($key)) {
            return array(self::MATCH_LOCATION_ID => $key);
        }
        return array(self::MATCH_LOCATION_REMOTE_ID => $key);
    }
1010123
protected function _get_array_value( $key ) {
		if ( ! isset( $this->types[ $key ] ) || 'array' !== $this->types[ $key ] ) {
			return null;
		}

		$default = array_key_exists( $key, $this->defaults ) ? $this->defaults[ $key ] : [];

		// @todo Could be taken a step further to array map strval?
		return (array) $this->store->get( $key, $default );
	}
297813
public function get(string $key)
    {
        $key = $this->hashKey($key);
        if (\array_key_exists($key, $this->cache)) {
            $this->hits++;
            return $this->cache[$key];
        }
        $this->misses++;
        return null;
    }
347991
protected function getConditionsFromKey($key)
    {
        if (is_int($key) || ctype_digit($key)) {
            return array(self::MATCH_USERGROUP_ID => $key);
        }
        return array(self::MATCH_CONTENT_REMOTE_ID => $key);
    }
862497
protected function fetchKey($key)
    {
        if (str_contains($key, '.'))
        {
            $keys = explode('.', $key);
            $search = array_except($keys, 0);

            return array(array_get($keys, 0), implode('.', $search));
        }

        return array($key, null);
    }
118276
function findKey( $key )
    {
        $msg = null;
        if ( isset( $this->Messages[$key] ) )
        {
            $msg = $this->Messages[$key];
        }
        return $msg;
    }
408443
protected function normalizeKey($key)
    {
        if (preg_match(static::$arrayKey, $key, $matches)) {
            $key = $matches[1];
            return $key;
        }
        return $key;
    }
544777
public function getFiles($key = null)
    {
        if ($key === null) {
            return $this->files;
        } else {
            return (isset($this->files[$key])) ? $this->files[$key] : null;
        }
    }
1296308
protected static function _getConfigByKey($key) {
		$dbConfig = self::_getEngine()->get($key);
		$fileConfig = Configure::read($key);
		if (!is_null($fileConfig)) {
			$dbConfig = Hash::mergeDiff((array)$dbConfig, $fileConfig);
		}

		return $dbConfig;
	}
837610
public function getNameByKey($key)
    {
        return (array_key_exists($key, $this->_languages)) ? $this->_languages[$key] : null;
    }