Get a vocabulary by name or ID

Taxonomy::vocabulary(1);
returns 'tags'

Taxonomy::vocabulary('tags');
returns 1

@param int|string $key
@return mixed
180710
public function vocabulary($key)
    {
        if (is_numeric($key)) {
            return $this->vocabularyById[$key]->machine_name;
        }

        return $this->vocabularyByName[$key]->id;
    }
972276
public function offsetGet($key)
    {
        $langs = Languages::getInstance($this->getCategory());
        return (isset($langs[$this->code][$key])) ?
            $langs[$this->code][$key] :
            $langs[$langs->getDefault()][$key];
    }
932520
public static function get($key = null)
    {
        if (null === self::$instance) {
            self::$instance = new self();
        }

        return $key ? self::$instance[$key] : self::$instance;
    }
1014430
public function get(string $key)
    {
        foreach ($this->pairs as $pair) {
            if ($key === $pair[0]) {
                return $pair[1];
            }
        }

        return null;
    }
639709
public function get($key)
  {
    $uuid = uniqid(static::CACHE_CHECK_PREFIX, true);
    $value = wp_cache_get($key, $this->getPrefix(), false, $uuid);

    if ($value !== $uuid) {
      return $value;
    }
  }
1218576
public function get($key)
    {
        $res = $this->_errors[$key];
        if (!is_array($res)) {
            return [$res];
        }

        return $res;
    }
650115
public function retrieve(string $key)
    {
        $token = null;

        $storageInstance = $this->getRepository();

        $token = $storageInstance->{$key}?? null;

        return $token;
    }
799253
public function get($key) {
        $key = $this->formatKey($key);
        return array_get($this->headers, $key, []);
    }
285660
public function get($key)
	{
		if (!$this->exists($key))
		{
			throw $this->getNotExistException($key);
		}

		$key = $this->normalizeKey($key);

		return $this->items[$key];
	}
190290
public function get($key)
    {
        $items = Arr::get($this->items, $key);

        return $this->firstOrAll($items);
    }
245096
public function get($key)
    {
        if (!$this->offsetExists($key)) {
            throw new InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $key));
        }
        return $this->offsetGet($key);
    }
1199367
private function lookupKey($key)
    {
        foreach ($this->pairs as $pair) {
            if ($this->keysAreEqual($pair->key, $key)) {
                return $pair;
            }
        }
    }
568181
public function get($key) 
    {
        return isset($this->langs[$key]) ? $this->langs[$key] : $key;
    }
487432
public function getDefinition($key)
    {
        if (isset($this->definitions['instance'][$key])) {
            return $this->definitions['instance'][$key];
        }

        return $this->definitions['instance'][$this->aliases[$key]];
    }
651718
public function get($key)
    {
        return isset($this->coll[$key]) ? $this->coll[$key] : false;
    }
626427
public function get($key = 'aliases')
    {
        return collect($this->getManifest())->flatMap(function ($configuration) use ($key) {
            return (array) ($configuration[$key] ?? []);
        })->filter()->all();
    }
537429
public function get($key)
	{
		if(array_key_exists($key, $this->scoped))
		{
			return $this->scoped[$key];
		}
	
		return $this->model->get($key, NULL);
	}