本文整理汇总了PHP中Symfony\Component\ExpressionLanguage\ExpressionLanguage::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP ExpressionLanguage::__construct方法的具体用法?PHP ExpressionLanguage::__construct怎么用?PHP ExpressionLanguage::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\ExpressionLanguage\ExpressionLanguage
的用法示例。
在下文中一共展示了ExpressionLanguage::__construct方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* ExpressionLanguage constructor.
*
* @param ParserCacheInterface|null $cache The cache
* @param array $providers Providers
*/
public function __construct(ParserCacheInterface $cache = null, array $providers = array())
{
parent::__construct($cache, $providers);
$reflectionProperty = new \ReflectionProperty('\\Symfony\\Component\\ExpressionLanguage\\ExpressionLanguage', 'lexer');
$reflectionProperty->setAccessible(true);
$reflectionProperty->setValue($this, new Lexer());
}
示例2: __construct
/**
*
* @param ExecutorInterface $executor
*/
public function __construct(ExecutorInterface $executor)
{
parent::__construct();
$this->executor = $executor;
$this->register('object', function ($name, $key) {
return sprintf('object("%s", "%s")', $name, $key);
}, function ($arguments, $name, $key) use($executor) {
$collection = $arguments['collection'];
$fixtureData = $collection->get($name)->get($key);
if (!($object = $fixtureData->getObject())) {
$object = $executor->createObject($collection, $name, $key);
}
return $object;
});
}
示例3: __construct
public function __construct(ParserCacheInterface $cache = null, array $providers = array())
{
// prepend the default provider to let users override it easily
array_unshift($providers, new ExpressionLanguageProvider());
parent::__construct($cache, $providers);
}
示例4: __construct
/**
* @inheritdoc
*/
public function __construct(ParserCacheInterface $cache = null, array $providers = array())
{
array_unshift($providers, new StringExpressionLanguageProvider());
array_unshift($providers, new DateTimeExpressionLanguageProvider());
parent::__construct($cache, $providers);
}
示例5: __construct
/**
* Construct
*
* @param ContainerInterface $container
* @param ParserCacheInterface $cache
* @param array $providers
*/
public function __construct(ContainerInterface $container, ParserCacheInterface $cache = null, array $providers = array())
{
$this->container = $container;
array_unshift($providers, new ServiceContainerFunctionProvider());
parent::__construct($cache, $providers);
}