Get the mode of a given key.

@param  mixed $key
@return array|null
@throws \InvalidArgumentException
423902
public function mode($key = null): ?array
    {
        /** @var array $result */
        $result = $this->reduce(function ($carry, $value, $valueKey) use ($key) {
            $item = $value;

            if ($key) {
                $item = $this->accessKey($value, $key, $valueKey);
            }

            if (!isset($carry[$item])) {
                $carry[$item] = 0;
            }

            $carry[$item]++;
            return $carry;
        }, []);

        if (!count($result)) {
            return null;
        }

        arsort($result);

        $output = [];
        $highestCount = 0;

        foreach ($result as $itemKey => $count) {
            if (!$highestCount) {
                $highestCount = $count;
            }

            if ($highestCount !== $count) {
                break;
            }

            $output[] = $itemKey;
        }

        return $output;
    }
98107
protected function _getState($key)
    {
        $sKey = (string) $key;

        return array_key_exists($sKey, $this->states)
            ? $this->states[$sKey]
            : null;
    }
632263
public function raw($key)
    {
        if (!isset($this->keys[$key])) {
            throw new \InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $key));
        }
        if (isset($this->raw[$key])) {
            return $this->raw[$key];
        }

        return $this->values[$id];
    }
215524
public function getProtectedHeaderParameter(string $key)
    {
        if ($this->hasProtectedHeaderParameter($key)) {
            return $this->getProtectedHeader()[$key];
        }

        throw new \InvalidArgumentException(\sprintf('The protected header "%s" does not exist', $key));
    }
640718
public function get($key)
    {
        if (!is_string($key)) {
            throw new \InvalidArgumentException('Expected string as key');
        }

        if (isset($this->data[$key])) {
            return $this->data[$key];
        } elseif (!$this->isDataLoadedFromDb) {
            $stmt = $this->db->prepare(
                'SELECT * FROM ' . $this->name . ' WHERE ' . $this->keyColumnName
                . ' = :key;'
            );
            $stmt->bindParam(':key', $key, \PDO::PARAM_STR);
            $stmt->execute();

            if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
                $this->data[$row[0]] = $row[1];
                return $this->data[$key];
            }
        }

        return null;
    }
983168
protected function getHelpValue($key)
    {
        if (!isset($this->helpValues[$key])) {
            throw new \InvalidArgumentException(sprintf('The required help value "%s" doesn\'t exist.', $key));
        }

        return $this->helpValues[$key];
    }
827734
public function getParameter($key) {
    if (is_string($key)) {
      return $this->getParameterByName($key);
    }
    elseif (is_integer($key)) {
      return $this->getParameterAtIndex($key);
    }
    else {
      throw new \InvalidArgumentException("Illegal parameter index {$key}.");
    }
  }
261462
protected function get($key)
    {
        $this->checkForNonEmptyKey($key);
        if (!$this->settingsHaveBeenRetrieved) {
            $this->retrieveSettings();
        }
        if (!isset($this->cachedSettings[$key])) {
            return null;
        }

        return $this->cachedSettings[$key];
    }
446020
public function getInfo( $key = NULL )
	{
		if( !$this->info )
			throw new RuntimeException( "No Request has been sent, yet." );
		if( !$key )
			return $this->info;
		if( !array_key_exists( $key, $this->info ) )
			throw new InvalidArgumentException( 'Status Key "'.$key.'" is invalid.' );
		return $this->info[$key];
	}
117319
public function getPlain($key = false)
    {
        if ($key) {
            if (isset($this->plain[$key])) {
                return $this->plain[$key];
            } else {
                return null;
            }
        } else {
            return $this->plain;
        }
    }
934873
protected function getOption($key)
    {
        if (!array_key_exists($key, $this->transformOptions)) {
            throw new \InvalidArgumentException(
                sprintf('Undefined option "%s"', $key)
            );
        }
        return $this->transformOptions[$key];
    }
149279
public function getParamValue($key)
    {
        $value = null;
        if (is_array($param = $this->getParam($key))) {
            $value = $param['value'];
        }

        return $value;
    }
996204
public function getParameter($key) {
		if (array_key_exists ( $key, $this->parameters ))
			return $this->parameters [$key];
		else
			return null;
	}
1173229
public function getParam($key)
    {
        if (!$this->hasParam($key)) {
            throw new InvalidException('Param '.$key.' does not exist');
        }

        return $this->_params[$key];
    }
245096
public function get($key)
    {
        if (!$this->offsetExists($key)) {
            throw new InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $key));
        }
        return $this->offsetGet($key);
    }
802065
public function get($key)
    {
        $key = strtolower($key);

        if (!isset($this->services[$key])) {
            throw new \InvalidArgumentException('Service not found: ' . $key);
        }

        // Have we been here before?
        if (isset($this->loadedService[$key])) {
            return $this->loadedService[$key];
        }

        if (!$this->services[$key] instanceof Service) {
            $this->loadedService[$key] = $this->services[$key];

            return $this->loadedService[$key];
        }

        // It's a Service instance, lets do some extra stuff.
        if (!$this->services[$key]->hasClassName()) {
            throw new \Exception('Unable to find class name from definition: ' . $key);
        }

        $className = $this->services[$key]->getClassName();
        $instance  = new $className();

        if ($this->services[$key]->hasFactoryMethod()) {
            call_user_func($instance, $this->services[$key]->getFactoryMethod());
        }

        $this->loadedService[$key] = $instance;

        return $this->loadedService[$key];
    }
579052
public function get($key)
    {
        if (!array_key_exists($key, $this->getDefaults())) {
            throw new InvalidArgumentException(sprintf('Key[%s] dont exists.', $key));
        }

        if (array_key_exists($key, $this->data)) {
            return $this->data[$key];
        }

        return $this->getDefaults()[$key];
    }