/** * 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()); }
/** * * @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; }); }
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); }
/** * @inheritdoc */ public function __construct(ParserCacheInterface $cache = null, array $providers = array()) { array_unshift($providers, new StringExpressionLanguageProvider()); array_unshift($providers, new DateTimeExpressionLanguageProvider()); parent::__construct($cache, $providers); }
/** * 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); }