8000 removed code that prevents the stopwatch to work properly · daifma/symfony@4590974 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4590974

Browse files
committed
removed code that prevents the stopwatch to work properly
1 parent 2f67776 commit 4590974

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

src/Symfony/Bridge/Twig/Tests/Extension/StopwatchExtensionTest.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ protected function setUp()
2626
}
2727
}
2828

29-
/**
30-
* @expectedException \Twig_Error_Syntax
31-
*/
32-
public function testFailIfNameAlreadyExists()
33-
{
34-
$this->testTiming('{% stopwatch foo %}{% endstopwatch %}{% stopwatch foo %}{% endstopwatch %}', array());
35-
}
36-
3729
/**
3830
* @expectedException \Twig_Error_Syntax
3931
*/
@@ -64,6 +56,7 @@ public function getTimingTemplates()
6456
array('{% stopwatch foo %}symfony2 is fun{% endstopwatch %}{% stopwatch bar %}something{% endstopwatch %}', array('foo', 'bar')),
6557
array('{% stopwatch foo %}something{% endstopwatch foo %}', 'foo'),
6658
array('{% stopwatch "foo.bar" %}something{% endstopwatch %}', 'foo.bar'),
59+
array('{% stopwatch foo %}something{% endstopwatch foo %}{% stopwatch foo %}something else{% endstopwatch foo %}', array('foo', 'foo')),
6760
);
6861
}
6962

src/Symfony/Bridge/Twig/TokenParser/StopwatchTokenParser.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
class StopwatchTokenParser extends \Twig_TokenParser
2222
{
2323
protected $stopwatchIsAvailable;
24-
protected $_events = array();
2524

2625
public function __construct($stopwatchIsAvailable)
2726
{
@@ -40,11 +39,6 @@ public function parse(\Twig_Token $token)
4039
$name = $stream->expect(\Twig_Token::STRING_TYPE)->getValue();
4140
}
4241

43-
if (in_array($name, $this->_events)) {
44-
throw new \Twig_Error_Syntax(sprintf('The stopwatch event "%s" has already been defined.', $name));
45-
}
46-
$this->_events[] = $name;
47-
4842
$stream->expect(\Twig_Token::BLOCK_END_TYPE);
4943

5044
// {% endstopwatch %} or {% endstopwatch bar %}

0 commit comments

Comments
 (0)
0