[ExpressionLanguage] Fix PhpDoc type-hints on Token value

Also added tests to cover number parser BC
This commit is contained in:
Jeremiah VALERIE 2017-11-09 15:39:19 +01:00 committed by Jeremiah VALERIE
parent 6fe8435c6f
commit 18f0fc594d
No known key found for this signature in database
GPG Key ID: 42F7707058FDC3D2
2 changed files with 11 additions and 3 deletions

View File

@ -116,6 +116,14 @@ class ExpressionLanguageTest extends TestCase
$this->assertSame('($a + $B)', $result);
}
public function testStrictEquality()
{
$expressionLanguage = new ExpressionLanguage();
$expression = '123 === a';
$result = $expressionLanguage->compile($expression, array('a'));
$this->assertSame('(123 === $a)', $result);
}
public function testCachingWithDifferentNamesOrder()
{
$cacheMock = $this->getMockBuilder('Symfony\Component\ExpressionLanguage\ParserCache\ParserCacheInterface')->getMock();

View File

@ -30,9 +30,9 @@ class Token
const PUNCTUATION_TYPE = 'punctuation';
/**
* @param string $type The type of the token (self::*_TYPE)
* @param string $value The token value
* @param int $cursor The cursor position in the source
* @param string $type The type of the token (self::*_TYPE)
* @param string|int|float|null $value The token value
* @param int $cursor The cursor position in the source
*/
public function __construct($type, $value, $cursor)
{