__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\DependencyInjection;
use Symfony\Component\DependencyInjection\Exception\LogicException;
use Symfony\Component\ExpressionLanguage\ExpressionFunction;
use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface;
/**
* Define some ExpressionLanguage functions.
*
* To get a service, use service('request').
* To get a parameter, use parameter('kernel.debug').
* To get an env variable, use env('SOME_VARIABLE').
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class ExpressionLanguageProvider implements ExpressionFunctionProviderInterface
{
private ?\Closure $serviceCompiler;
private ?\Closure $getEnv;
public function __construct(?callable $serviceCompiler = null, ?\Closure $getEnv = null)
{
$this->serviceCompiler = null === $serviceCompiler ? null : $serviceCompiler(...);
$this->getEnv = $getEnv;
}
public function getFunctions(): array
{
return [
new ExpressionFunction('service', $this->serviceCompiler ?? fn ($arg) => sprintf('$container->get(%s)', $arg), fn (array $variables, $value) => $variables['container']->get($value)),
new ExpressionFunction('parameter', fn ($arg) => sprintf('$container->getParameter(%s)', $arg), fn (array $variables, $value) => $variables['container']->getParameter($value)),
new ExpressionFunction('env', fn ($arg) => sprintf('$container->getEnv(%s)', $arg), function (array $variables, $value) {
if (!$this->getEnv) {
throw new LogicException('You need to pass a getEnv closure to the expression langage provider to use the "env" function.');
}
return ($this->getEnv)($value);
}),
new ExpressionFunction('arg', fn ($arg) => sprintf('$args?->get(%s)', $arg), fn (array $variables, $value) => $variables['args']?->get($value)),
];
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Argument | Folder | 0755 |
|
|
| Attribute | Folder | 0755 |
|
|
| Compiler | Folder | 0755 |
|
|
| Config | Folder | 0755 |
|
|
| Dumper | Folder | 0755 |
|
|
| Exception | Folder | 0755 |
|
|
| Extension | Folder | 0755 |
|
|
| LazyProxy | Folder | 0755 |
|
|
| Loader | Folder | 0755 |
|
|
| ParameterBag | Folder | 0755 |
|
|
| Alias.php | File | 2.9 KB | 0644 |
|
| ChildDefinition.php | File | 2.56 KB | 0644 |
|
| Container.php | File | 13.6 KB | 0644 |
|
| ContainerAwareInterface.php | File | 681 B | 0644 |
|
| ContainerAwareTrait.php | File | 1.06 KB | 0644 |
|
| ContainerBuilder.php | File | 59.07 KB | 0644 |
|
| ContainerInterface.php | File | 2.28 KB | 0644 |
|
| Definition.php | File | 20.17 KB | 0644 |
|
| EnvVarLoaderInterface.php | File | 654 B | 0644 |
|
| EnvVarProcessor.php | File | 13.01 KB | 0644 |
|
| EnvVarProcessorInterface.php | File | 1.24 KB | 0644 |
|
| ExpressionLanguage.php | File | 1.05 KB | 0644 |
|
| ExpressionLanguageProvider.php | File | 2.12 KB | 0644 |
|
| Parameter.php | File | 601 B | 0644 |
|
| Reference.php | File | 945 B | 0644 |
|
| ReverseContainer.php | File | 2.4 KB | 0644 |
|
| ServiceLocator.php | File | 5.3 KB | 0644 |
|
| TaggedContainerInterface.php | File | 688 B | 0644 |
|
| TypedReference.php | File | 1.54 KB | 0644 |
|
| Variable.php | File | 692 B | 0644 |
|
| autoload.php | File | 25.98 KB | 0644 |
|