null, $share = false)
{
unset($this->shared[$alias]);
unset($this->definitions[$alias]);
unset($this->sharedDefinitions[$alias]);
if (is_null($concrete)) {
$concrete = $alias;
}
$definition = $this->definitionFactory->getDefinition($alias, $concrete);
if ($definition instanceof DefinitionInterface) {
if ($share === false) {
$this->definitions[$alias] = $definition;
} else {
$this->sharedDefinitions[$alias] = $definition;
}
return $definition;
}
// dealing with a value that cannot build a definition
$this->shared[$alias] = $concrete;
}
/**
* {@inheritdoc}
*/
public function share($alias, $concrete = null)
{
return $this->add($alias, $concrete, true);
}
/**
* {@inheritdoc}
*/
public function addServiceProvider($provider)
{
$this->providers->add($provider);
return $this;
}
/**
* {@inheritdoc}
*/
public function extend($alias)
{
if ($this->providers->provides($alias)) {
$this->providers->register($alias);
}
if (array_key_exists($alias, $this->definitions)) {
return $this->definitions[$alias];
}
if (array_key_exists($alias, $this->sharedDefinitions)) {
return $this->sharedDefinitions[$alias];
}
throw new NotFoundException(
sprintf('Unable to extend alias (%s) as it is not being managed as a definition', $alias)
);
}
/**
* {@inheritdoc}
*/
public function inflector($type, callable $callback = null)
{
return $this->inflectors->add($type, $callback);
}
/**
* {@inheritdoc}
*/
public function call(callable $callable, array $args = [])
{
return (new ReflectionContainer)->setContainer($this)->call($callable, $args);
}
/**
* Delegate a backup container to be checked for services if it
* cannot be resolved via this container.
*
* @param \Interop\Container\ContainerInterface $container
* @return $this
*/
public function delegate(InteropContainerInterface $container)
{
$this->delegates[] = $container;
if ($container instanceof ImmutableContainerAwareInterface) {
$container->setContainer($this);
}
return $this;
}
/**
* Returns true if service is registered in one of the delegated backup containers.
*
* @param string $alias
* @return boolean
*/
public function hasInDelegate($alias)
{
foreach ($this->delegates as $container) {
if ($container->has($alias)) {
return true;
}
}
return false;
}
/**
* Attempt to get a service from the stack of delegated backup containers.
*
* @param string $alias
* @param array $args
* @return mixed
*/
protected function getFromDelegate($alias, array $args = [])
{
foreach ($this->delegates as $container) {
if ($container->has($alias)) {
return $container->get($alias, $args);
}
continue;
}
throw new NotFoundException(
sprintf('Alias (%s) is not being managed by the container', $alias)
);
}
/**
* Get a service that has been registered in this container.
*
* @param string $alias
* @param array $args
* @return mixed
*/
protected function getFromThisContainer($alias, array $args = [])
{
if ($this->hasShared($alias, true)) {
$shared = $this->inflectors->inflect($this->shared[$alias]);
if ($shared instanceof RawArgumentInterface) {
return $shared->getValue();
}
return $shared;
}
if (array_key_exists($alias, $this->sharedDefinitions)) {
$shared = $this->inflectors->inflect($this->sharedDefinitions[$alias]->build());
$this->shared[$alias] = $shared;
return $shared;
}
if (array_key_exists($alias, $this->definitions)) {
return $this->inflectors->inflect(
$this->definitions[$alias]->build($args)
);
}
throw new NotFoundException(
sprintf('Alias (%s) is not being managed by the container', $alias)
);
}
}
Fatal error: Uncaught Error: Class 'League\Container\Container' not found in /home/payon/public_html/wp-content/plugins/wp-rocket/inc/classes/class-plugin.php:32
Stack trace:
#0 /home/payon/public_html/wp-content/plugins/wp-rocket/inc/main.php(39): WP_Rocket\Plugin->__construct('/home/payon/pub...')
#1 /home/payon/public_html/wp-includes/class-wp-hook.php(308): rocket_init('')
#2 /home/payon/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
#3 /home/payon/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#4 /home/payon/public_html/wp-settings.php(486): do_action('plugins_loaded')
#5 /home/payon/public_html/wp-config.php(92): require_once('/home/payon/pub...')
#6 /home/payon/public_html/wp-load.php(50): require_once('/home/payon/pub...')
#7 /home/payon/public_html/wp-blog-header.php(13): require_once('/home/payon/pub...')
#8 /home/payon/public_html/index.php(17): require('/home/payon/pub...')
#9 {main}
thrown in /home/payon/public_html/wp-content/plugins/wp-rocket/inc/classes/class-plugin.php on line 32