Skip to content

Commit c43c35c

Browse files
committed
[ExpressionLanguage] fixed CS
1 parent db00c3f commit c43c35c

File tree

4 files changed

+31
-9
lines changed

4 files changed

+31
-9
lines changed

src/Symfony/Bridge/Doctrine/Tests/ExpressionLanguage/DoctrineParserCacheTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\Bridge\Doctrine\Tests\ExpressionLanguage;
413

514
use Symfony\Bridge\Doctrine\ExpressionLanguage\DoctrineParserCache;

src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,16 @@ class ExpressionLanguage
2424
/**
2525
* @var ParserCacheInterface
2626
*/
27-
private $parserCache;
28-
27+
private $cache;
2928
private $lexer;
3029
private $parser;
3130
private $compiler;
3231

3332
protected $functions;
3433

35-
public function __construct(ParserCacheInterface $parserCache = null)
34+
public function __construct(ParserCacheInterface $cache = null)
3635
{
37-
$this->parserCache = $parserCache ?: new ArrayParserCache();
36+
$this->cache = $cache ?: new ArrayParserCache();
3837
$this->functions = array();
3938
$this->registerFunctions();
4039
}
@@ -80,11 +79,11 @@ public function parse($expression, $names)
8079

8180
$key = $expression.'//'.implode('-', $names);
8281

83-
if (null === $parsedExpression = $this->parserCache->fetch($key)) {
82+
if (null === $parsedExpression = $this->cache->fetch($key)) {
8483
$nodes = $this->getParser()->parse($this->getLexer()->tokenize((string) $expression), $names);
8584
$parsedExpression = new ParsedExpression((string) $expression, $nodes);
8685

87-
$this->parserCache->save($key, $parsedExpression);
86+
$this->cache->save($key, $parsedExpression);
8887
}
8988

9089
return $parsedExpression;

src/Symfony/Component/ExpressionLanguage/ParserCache/ParserCacheInterface.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,18 @@
1919
interface ParserCacheInterface
2020
{
2121
/**
22-
* @param string $key
23-
* @param ParsedExpression $data
22+
* Saves an expression in the cache.
23+
*
24+
* @param string $key The cache key
25+
* @param ParsedExpression $data A ParsedExpression instance to store in the cache
2426
*/
2527
public function save($key, ParsedExpression $expression);
2628

2729
/**
28-
* @param string $key
30+
* Fetches an expression from the cache.
31+
*
32+
* @param string $key The cache key
33+
*
2934
* @return ParsedExpression|null
3035
*/
3136
public function fetch($key);

src/Symfony/Component/ExpressionLanguage/Tests/ExpressionLanguageTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\Component\ExpressionLanguage\Tests;
413

514
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;

0 commit comments

Comments
 (0)