Skip to content

Commit 975f6f6

Browse files
Merge branch '4.0'
* 4.0: (42 commits) fix merge Remove some unused variables and properties [appveyor] disable memory limit on composer up [HttpFoundation] don't prefix cookies with "Set-Cookie:" Remove some unused variables and properties [HttpFoundation] Fixed default user-agent (3.X -> 4.X) Fix debug:form definition Remove some unused variables, properties and methods fix some edge cases with indented blocks [ExpressionLanguage] Fix parse error on 5.3 [HttpKernel] remove noisy frame in controller stack traces [DI] Force root-namespace for function calls in the dumper container [DI] Fix circular-aliases message register system cache clearer only if it's used doc : Namespace prefix must end with a "\" [ExpressionLanguage] throw an SyntaxError instead of letting a undefined index notice Prevent a loop in aliases within the `findDefinition` method [HttpKernel] Disable inlining on PHP 5 Ensure that inlined services with parameterized class name can be dumped [DI] Fix non-string class handling in PhpDumper ...
2 parents 915ed14 + 6776bbd commit 975f6f6

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
@@ -105,6 +105,16 @@ public function testShortCircuitOperatorsCompile($expression, array $names, $exp
105105
$this->assertSame($expected, $result);
106106
}
107107

108+
/**
109+
* @expectedException \Symfony\Component\ExpressionLanguage\SyntaxError
110+
* @expectedExceptionMessage Unexpected end of expression around position 6 for expression `node.`.
111+
*/
112+
public function testParseThrowsInsteadOfNotice()
113+
{
114+
$expressionLanguage = new ExpressionLanguage();
115+
$expressionLanguage->parse('node.', array('node'));
116+
}
117+
108118
public function shortCircuitProviderEvaluate()
109119
{
110120
$object = $this->getMockBuilder('stdClass')->setMethods(array('foo'))->getMock();

TokenStream.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ public function __toString()
4646
*/
4747
public function next()
4848
{
49+
++$this->position;
50+
4951
if (!isset($this->tokens[$this->position])) {
5052
throw new SyntaxError('Unexpected end of expression', $this->current->cursor, $this->expression);
5153
}
5254

53-
++$this->position;
54-
5555
$this->current = $this->tokens[$this->position];
5656
}
5757

0 commit comments

Comments
 (0)