Skip to content

[ExpressionLanguage] Fixed PhpDoc type-hints on Token value #24884

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

Merged
merged 1 commit into from
Nov 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ public function testCachingForOverriddenVariableNames()
$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();
Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Component/ExpressionLanguage/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down