8000 Feedback in cache:clear by jrmyio · Pull Request #9463 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Feedback in cache:clear #9463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added ability to set custom parser
  • Loading branch information
jrmyio committed Nov 15, 2013
commit 1a0941c988ac1d1323789022cffb37e586b9fcd7
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,22 @@
*/
class ExpressionLanguage
{

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove line break

/**
* @var ParserCacheInterface
*/
private $cache;
private $lexer;
private $parser;
private $parserClass;
private $compiler;

protected $functions;

public function __construct(ParserCacheInterface $cache = null)
public function __construct(ParserCacheInterface $cache = null, $parserClass = null)
{
$this->cache = $cache ?: new ArrayParserCache();
$this->parserClass = $parserClass ?: "Symfony\\Component\\ExpressionLanguage\\Parser";
$this->functions = array();
$this->registerFunctions();
}
Expand Down Expand Up @@ -122,7 +125,7 @@ private function getLexer()
private function getParser()
{
if (null === $this->parser) {
$this->parser = new Parser($this->functions);
$this->parser = new $this->parserClass($this->functions);
}

return $this->parser;
Expand Down
0