@param string $key

@return DependencyInjectionException
161171
public static function keyNotRegistered(string $key) : DependencyInjectionException
    {
        if (class_exists($key)) {
            $message = 'The class "' . $key . '" is not marked as injected, and not registered with the container.';
        } else {
            $message = 'The key "' . $key . '" is not registered with the container.';
        }

        return new self($message);
    }
298133
protected function lock(string $key)
    {
        if (isset($this->locks[$key])) {
            throw new InvalidArgumentError('Key was already locked.');
        }

        $this->locks[$key] = new Delayed();
    }
809146
protected function injectDependency($propertyName, $dependencyName){
        EnolaContext::getInstance()->app->dependenciesEngine->injectDependency($this,$propertyName,$dependencyName);
    }
441207
public function get($key): ClientInterface
    {
        if (!isset($this->clients[$key])) {
            throw new \LogicException("The Remote Service {$key} does not exist or has not been configured.");
        }

        return $this->clients[$key];
    }
321616
public function setKey($key)
    {
        try {
            $this->blockCipher->setKey($key);
        } catch (CryptException\InvalidArgumentException $e) {
            throw new Exception\InvalidArgumentException($e->getMessage());
        }
        $this->encryption['key'] = $key;
        return $this;
    }
330325
public function resolve($key)
    {
        try {
            return $this->resolver->resolve($key);
        } catch (\Exception $e) {
            throw new UnresolvableObjectException($key, $e);
        }
    }
832127
protected function load($key) {
        try {
            return $this->memcached->get($key);
        } catch (\Exception $e) {
            throw new StorageException("Failed to load memcached key: $key", 1, $e);
        }
    }
651595
public function take(string $key)
    {
        $key = $this->getValue($key);
        $this->remove($key);
        return $key;
    }
1357207
public function getDependency(string $index)
    {
        if (! isset($this->container[$index])) {
            throw $this->unbound($index);
        }
        $dependency = $this->container[$index];

        return $dependency->inject($this);
    }
100062
public function filterByPrimaryKey($key)
    {
        $this->addUsingAlias(SkillDependencyTableMap::COL_DEPENDENCY_ID, $key[0], Criteria::EQUAL);
        $this->addUsingAlias(SkillDependencyTableMap::COL_PARENT_ID, $key[1], Criteria::EQUAL);

        return $this;
    }
1129471
public function get(string $key)
    {
        if ($this->replacedPayload) {
            if (! \array_key_exists($key, $this->payload)) {
                throw new \BadMethodCallException("Message payload of {$this->messageName()} does not contain a key $key.");
            }

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

        if ($key !== self::MESSAGE) {
            throw new \BadMethodCallException(__CLASS__ . ' payload only contains a ' . self::MESSAGE . ' key.');
        }

        return $this->message;
    }
1041761
public function load($key)
    {
        if (file_exists($path = $this->path . $key)) {
            return unserialize(file_get_contents($path));
        }

        return null;
    }
1040360
public function getRequired(string $key)
    {
        if (!isset($this->values[$key])) {
            throw new \RuntimeException(
                "the required config value '$key' was not found"
            );
        }
        return $this->values[$key];
    }
906055
protected function getMethod($key)
    {
        switch ($key) {
            case CopyMethod::NAME:
                return new CopyMethod();
            case SymlinkMethod::NAME:
                return new SymlinkMethod();
            case JunctionMethod::NAME:
                return new JunctionMethod();
            case VendorPlugin::METHOD_NONE:
                // 'none' is forced to an empty chain
                return new ChainedMethod([]);
            case VendorPlugin::METHOD_AUTO:
                // Default to safe-failover method
                if (Platform::isWindows()) {
                    // Use junctions on windows environment
                    return new ChainedMethod(new JunctionMethod(), new CopyMethod());
                } else {
                    // Use symlink on non-windows environments
                    return new ChainedMethod(new SymlinkMethod(), new CopyMethod());
                }
            default:
                throw new InvalidArgumentException("Invalid method: {$key}");
        }
    }
1209710
public function addDependency(string $dependencyName): self
    {
        if (!property_exists($this->loadInfos, 'require')) {
            $this->loadInfos->require = [];
        }
        
        if (!is_array($this->loadInfos->require)) {
            $this->loadInfos->require = [$this->loadInfos->require];
        }
        
        $this->loadInfos->require[] = $dependencyName;
        
        return $this;
    }
121381
public function getMethodByAlias($key)
    {
        if (isset($this->methodList[$key]))
        {
            return $this->methodList[$key];
        }
        else
        {
            throw new Exception($key . 'method not found.');
        }
    }
106978
public function detachLoader($key)
    {
        if (empty($this->loaders[$key])) {

            throw new \InvalidArgumentException(
                'No registered loader found.',
                DataAggregatorException::LOADER_NOT_FOUND
            );
        }

        unset($this->loaders[$key]);
    }