== \strpos($className, '@anonymous') ? $this->definitionSource->getDefinition($className) : $this->getDefinition($className);
if (!$objectDefinition instanceof ObjectDefinition) {
return $instance;
}
$definition = new InstanceDefinition($instance, $objectDefinition);
$this->definitionResolver->resolve($definition);
return $instance;
}
/**
* Call the given function using the given parameters.
*
* Missing parameters will be resolved from the container.
*
* @param callable $callable Function to call.
* @param array $parameters Parameters to use. Can be indexed by the parameter names
* or not indexed (same order as the parameters).
* The array can also contain DI definitions, e.g. DI\get().
*
* @return mixed Result of the function.
*/
public function call($callable, array $parameters = [])
{
return $this->getInvoker()->call($callable, $parameters);
}
/**
* Define an object or a value in the container.
*
* @param string $name Entry name
* @param mixed|DefinitionHelper $value Value, use definition helpers to define objects
*/
public function set(string $name, $value)
{
if ($value instanceof DefinitionHelper) {
$value = $value->getDefinition($name);
} elseif ($value instanceof \Closure) {
$value = new FactoryDefinition($name, $value);
}
if ($value instanceof ValueDefinition) {
$this->resolvedEntries[$name] = $value->getValue();
} elseif ($value instanceof Definition) {
$value->setName($name);
$this->setDefinition($name, $value);
} else {
$this->resolvedEntries[$name] = $value;
}
}
/**
* Get defined container entries.
*
* @return string[]
*/
public function getKnownEntryNames() : array
{
$entries = \array_unique(\array_merge(\array_keys($this->definitionSource->getDefinitions()), \array_keys($this->resolvedEntries)));
\sort($entries);
return $entries;
}
/**
* Get entry debug information.
*
* @param string $name Entry name
*
* @throws InvalidDefinition
* @throws NotFoundException
*/
public function debugEntry(string $name) : string
{
$definition = $this->definitionSource->getDefinition($name);
if ($definition instanceof Definition) {
return (string) $definition;
}
if (\array_key_exists($name, $this->resolvedEntries)) {
return $this->getEntryType($this->resolvedEntries[$name]);
}
throw new NotFoundException("No entry or class found for '{$name}'");
}
/**
* Get formatted entry type.
*
* @param mixed $entry
*/
private function getEntryType($entry) : string
{
if (\is_object($entry)) {
return \sprintf("Object (\n class = %s\n)", \get_class($entry));
}
if (\is_array($entry)) {
return \preg_replace(['/^array \\(/', '/\\)$/'], ['[', ']'], \var_export($entry, \true));
}
if (\is_string($entry)) {
return \sprintf('Value (\'%s\')', $entry);
}
if (\is_bool($entry)) {
return \sprintf('Value (%s)', $entry === \true ? 'true' : 'false');
}
return \sprintf('Value (%s)', \is_scalar($entry) ? $entry : \ucfirst(\gettype($entry)));
}
/**
* Resolves a definition.
*
* Checks for circular dependencies while resolving the definition.
*
* @throws DependencyException Error while resolving the entry.
* @return mixed
*/
private function resolveDefinition(Definition $definition, array $parameters = [])
{
$entryName = $definition->getName();
// Check if we are already getting this entry -> circular dependency
if (isset($this->entriesBeingResolved[$entryName])) {
throw new DependencyException("Circular dependency detected while trying to resolve entry '{$entryName}'");
}
$this->entriesBeingResolved[$entryName] = \true;
// Resolve the definition
try {
$value = $this->definitionResolver->resolve($definition, $parameters);
} finally {
unset($this->entriesBeingResolved[$entryName]);
}
return $value;
}
protected function setDefinition(string $name, Definition $definition)
{
// Clear existing entry if it exists
if (\array_key_exists($name, $this->resolvedEntries)) {
unset($this->resolvedEntries[$name]);
}
$this->fetchedDefinitions = [];
// Completely clear this local cache
$this->definitionSource->addDefinition($definition);
}
private function getInvoker() : InvokerInterface
{
if (!$this->invoker) {
$parameterResolver = new ResolverChain([new DefinitionParameterResolver($this->definitionResolver), new NumericArrayResolver(), new AssociativeArrayResolver(), new DefaultValueResolver(), new TypeHintContainerResolver($this->delegateContainer)]);
$this->invoker = new Invoker($parameterResolver, $this);
}
return $this->invoker;
}
private function createDefaultDefinitionSource() : SourceChain
{
$source = new SourceChain([new ReflectionBasedAutowiring()]);
$source->setMutableDefinitionSource(new DefinitionArray([], new ReflectionBasedAutowiring()));
return $source;
}
}
Fatal error: Uncaught Error: Class 'ElementorDeps\DI\Container' not found in /var/www/html/dportilho.com.br/web/wp-content/plugins/elementor/vendor_prefixed/php-di/php-di/src/ContainerBuilder.php:155
Stack trace:
#0 /var/www/html/dportilho.com.br/web/wp-content/plugins/elementor/includes/container/container.php(37): ElementorDeps\DI\ContainerBuilder->build()
#1 /var/www/html/dportilho.com.br/web/wp-content/plugins/elementor/includes/container/container.php(45): Elementor\Container\Container::initialize()
#2 /var/www/html/dportilho.com.br/web/wp-content/plugins/elementor/includes/plugin.php(645): Elementor\Container\Container::initialize_instance()
#3 /var/www/html/dportilho.com.br/web/wp-content/plugins/elementor/includes/plugin.php(888): Elementor\Plugin->initialize_container()
#4 /var/www/html/dportilho.com.br/web/wp-content/plugins/elementor/elementor.php(58): require('/var/www/html/d...')
#5 /var/www/html/dportilho.com.br/web/wp-settings.php(526): include_once('/var/www/html/d...')
#6 /var/www/html/dportilho.com.br/we in /var/www/html/dportilho.com.br/web/wp-content/plugins/elementor/vendor_prefixed/php-di/php-di/src/ContainerBuilder.php on line 155