Filter the list of eligible keys and keep those that have at least two matches

@param  array[] $eligibleKeys List of lists of keys
@return array[]
194427
protected function filterEligibleKeys(array $eligibleKeys)
	{
		$filteredKeys = [];
		foreach ($eligibleKeys as $k => $keys)
		{
			if (count($keys) > 1)
			{
				$filteredKeys[] = $keys;
			}
		}

		return $filteredKeys;
	}
85498
public function filterByKeys(array $keys)
    {
        /** @noinspection PhpMethodParametersCountMismatchInspection */
        $newInstance = new self();
        $newInstance->setArray(array_filter($this->array, function ($key) use ($keys) {
            return array_search($key, $keys) !== false;
        }, ARRAY_FILTER_USE_KEY));
        return $newInstance;
    }
1362696
public function many(array $keys)
    {
        $normalizedKeys = [];

        foreach ($keys as $key => $value) {
            $normalizedKeys[] = is_string($key) ? $key : $value;
        }

        $values = $this->store->many($normalizedKeys);

        foreach ($values as $key => &$value) {
            if (is_null($value) || $value === false) {
                $this->fireCacheEvent('missed', [$key]);

                $value = isset($keys[$key]) ? value($keys[$key]) : null;
            } else {
                $this->fireCacheEvent('hit', [$key, $value]);
            }
        }

        return $values;
    }
38579
public function many(array $keys)
  {
    $results = [];

    foreach ($keys as $key) {
      $results[$key] = $this->get($key);
    }

    return $results;
  }
1086171
protected function _setKeys($keys)
    {
        if (!is_array($keys)) {
            throw new Exception\InvalidArgumentException('Invalid options argument provided to filter');
        }

        foreach ($keys as $type => $key) {
            if (is_file($key) and is_readable($key)) {
                $file = fopen($key, 'r');
                $cert = fread($file, 8192);
                fclose($file);
            } else {
                $cert = $key;
                $key  = count($this->keys[$type]);
            }

            switch ($type) {
                case 'public':
                    $test = openssl_pkey_get_public($cert);
                    if ($test === false) {
                        throw new Exception\InvalidArgumentException("Public key '{$cert}' not valid");
                    }

                    openssl_free_key($test);
                    $this->keys['public'][$key] = $cert;
                    break;
                case 'private':
                    $test = openssl_pkey_get_private($cert, $this->passphrase);
                    if ($test === false) {
                        throw new Exception\InvalidArgumentException("Private key '{$cert}' not valid");
                    }

                    openssl_free_key($test);
                    $this->keys['private'][$key] = $cert;
                    break;
                case 'envelope':
                    $this->keys['envelope'][$key] = $cert;
                    break;
                default:
                    break;
            }
        }

        return $this;
    }
800312
public static function filter_keys($arr, $keys)
    {
        foreach ($arr as $key => $v) {
            if (!in_array($key, $keys)) {
                unset($arr[$key]);
            }
        }

        return $arr;
    }
997062
public function filterByPrimaryKeys($keys)
    {
        if (empty($keys)) {
            return $this->add(null, '1<>1', Criteria::CUSTOM);
        }
        foreach ($keys as $key) {
            $cton0 = $this->getNewCriterion(PersonFunctionVersionTableMap::ID, $key[0], Criteria::EQUAL);
            $cton1 = $this->getNewCriterion(PersonFunctionVersionTableMap::VERSION, $key[1], Criteria::EQUAL);
            $cton0->addAnd($cton1);
            $this->addOr($cton0);
        }

        return $this;
    }
527191
public static function array_filter_keys($array, $params = null)
    {

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

        $isMultidimensionnal = self::is_multi($array);

        if (is_string($params)) {
            $params = array('with' => $params);
        }

        if (isset($params['with'])) {
            $data = array();

            if (!$isMultidimensionnal) {
                foreach ($array as $key => $value) {
                    if (preg_match('/' . $params['with'] . '/i', $key)) {
                        $data[] = $value;
                    }
                }
            } else {
                foreach ($array as $v1) {
                    foreach ($v1 as $key => $value) {
                        if (preg_match('/' . $params['with'] . '/i', $key)) {
                            $data[] = $value;
                        }
                    }
                }
            }

            return $data;
        }

        return array_filter($array);

    }
1304504
public function findByKeys(array $keys)
    {
        $result = [];
        /** @var Cursor $list */
        $list = $this->collection->find(['_id' => ['$in' => $keys]]);

        foreach ($list as $document) {
            $result[] = $this->hydrateEntity($document);
        }

        return $result;
    }
957945
public function only($keys)
    {
        // Convert $keys to array if necessary
        if (!is_array($keys)) {
            $keys = preg_split("/, */", $keys, -1, PREG_SPLIT_NO_EMPTY);
        }

        foreach ($keys as $id => $key) {
            $keys[$id] = $this->normalizeKey($key);
        }

        // Compare filter items by provided keys and return new array
        return array_intersect_key($this->data, array_flip($keys));
    }
299158
public function getParams(array $keys = null)
    {
        $params = $this->params;

        if ($keys) {
            $subset = [];
            foreach ($keys as $key) {
                if (array_key_exists($key, $params)) {
                    $subset[$key] = $params[$key];
                }
            }
            return $subset;
        }

        return $params;
    }
1186750
public function getKeysByName($names)
    {
        if (empty($names)) {
            return [];
        }

        return $this->whereIn('name', $names)
                    ->select($this->getKeyName())->get()
                    ->pluck($this->getKeyName())->all();
    }
1008654
public final function getItems(array $keys = [])
   {
       try {
           $item = [];
           foreach ($keys as $value) {
               $item[$value] = $this->getItem($value);
           }
       } catch (InvalidArgumentException $e) {
           throw $e;
       }
       return $item;
       
   }
1341822
protected function getEligibleKeys(array $strings)
	{
		$eligibleKeys = [];
		foreach ($strings as $k => $string)
		{
			if (!is_array($string[0]) && isset($string[1]))
			{
				$suffix = serialize(array_slice($string, 1));
				$eligibleKeys[$suffix][] = $k;
			}
		}

		return $this->filterEligibleKeys($eligibleKeys);
	}
97243
public function filterByPrimaryKeys($keys)
    {
        if (empty($keys)) {
            return $this->add(null, '1<>1', Criteria::CUSTOM);
        }
        foreach ($keys as $key) {
            $cton0 = $this->getNewCriterion(UserRoleTableMap::COL_USER_ID, $key[0], Criteria::EQUAL);
            $cton1 = $this->getNewCriterion(UserRoleTableMap::COL_ROLE_ID, $key[1], Criteria::EQUAL);
            $cton0->addAnd($cton1);
            $this->addOr($cton0);
        }

        return $this;
    }
1199619
public function hasKeys(array $keys): array
    {
        $list = [];
        foreach ($keys as $key) {
            $list[$key] = $this->hasKey((string)$key);
        }

        return $list;
    }
782086
public function many(array $keys)
    {
        $results = [];

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

        foreach ($values as $index => $value) {
            $results[$keys[$index]] = ! is_null($value) ? $this->unserialize($value) : null;
        }

        return $results;
    }