Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cf78277

Browse filesBrowse files
committed
minor #24884 [ExpressionLanguage] Fixed PhpDoc type-hints on Token value (mcg-web)
This PR was merged into the 2.7 branch. Discussion ---------- [ExpressionLanguage] Fixed PhpDoc type-hints on Token value | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | none | License | MIT | Doc PR | none Fixed PhpDoc type-hints on Token value and added test to prevent BC with Parser when treating numbers (example `a === 123` compile as `$a === "123"`) Commits ------- 18f0fc5 [ExpressionLanguage] Fix PhpDoc type-hints on Token value
2 parents 6fe8435 + 18f0fc5 commit cf78277
Copy full SHA for cf78277

File tree

Expand file treeCollapse file tree

2 files changed

+11
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+11
-3
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/ExpressionLanguage/Tests/ExpressionLanguageTest.php
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ public function testCachingForOverriddenVariableNames()
116116
$this->assertSame('($a + $B)', $result);
117117
}
118118

119+
public function testStrictEquality()
120+
{
121+
$expressionLanguage = new ExpressionLanguage();
122+
$expression = '123 === a';
123+
$result = $expressionLanguage->compile($expression, array('a'));
124+
$this->assertSame('(123 === $a)', $result);
125+
}
126+
119127
public function testCachingWithDifferentNamesOrder()
120128
{
121129
$cacheMock = $this->getMockBuilder('Symfony\Component\ExpressionLanguage\ParserCache\ParserCacheInterface')->getMock();

‎src/Symfony/Component/ExpressionLanguage/Token.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/ExpressionLanguage/Token.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ class Token
3030
const PUNCTUATION_TYPE = 'punctuation';
3131

3232
/**
33-
* @param string $type The type of the token (self::*_TYPE)
34-
* @param string $value The token value
35-
* @param int $cursor The cursor position in the source
33+
* @param string $type The type of the token (self::*_TYPE)
34+
* @param string|int|float|null $value The token value
35+
* @param int $cursor The cursor position in the source
3636
*/
3737
public function __construct($type, $value, $cursor)
3838
{

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.