Skip to content

Commit c5b04fe

Browse files
Merge branch '2.8' into 3.3
* 2.8: Remove some unused variables, properties and methods [ExpressionLanguage] Fix parse error on 5.3 [HttpKernel] remove noisy frame in controller stack traces [ExpressionLanguage] throw an SyntaxError instead of letting a undefined index notice Fix php doc in Table class bumped Symfony version to 2.8.33 updated VERSION for 2.8.32 updated CHANGELOG for 2.8.32 bumped Symfony version to 2.7.40 updated VERSION for 2.7.39 update CONTRIBUTORS for 2.7.39 updated CHANGELOG for 2.7.39
2 parents c46362f + 2b79dae commit c5b04fe

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Tests/ExpressionLanguageTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,16 @@ public function testShortCircuitOperatorsCompile($expression, array $names, $exp
146146
$this->assertSame($expected, $result);
147147
}
148148

149+
/**
150+
* @expectedException \Symfony\Component\ExpressionLanguage\SyntaxError
151+
* @expectedExceptionMessage Unexpected end of expression around position 6 for expression `node.`.
152+
*/
153+
public function testParseThrowsInsteadOfNotice()
154+
{
155+
$expressionLanguage = new ExpressionLanguage();
156+
$expressionLanguage->parse('node.', array('node'));
157+
}
158+
149159
public function shortCircuitProviderEvaluate()
150160
{
151161
$object = $this->getMockBuilder('stdClass')->setMethods(array('foo'))->getMock();

TokenStream.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ public function __toString()
5050
*/
5151
public function next()
5252
{
53+
++$this->position;
54+
5355
if (!isset($this->tokens[$this->position])) {
5456
throw new SyntaxError('Unexpected end of expression', $this->current->cursor, $this->expression);
5557
}
5658

57-
++$this->position;
58-
5959
$this->current = $this->tokens[$this->position];
6060
}
6161

0 commit comments

Comments
 (0)