Merge branch '2.8' into 3.1

* 2.8:
  [Validator] Fix annotation
  [TwigBridge] Use non-deprecated Twig_Node::getTemplateLine()
  [WebProfilerBundle][btn-link] add `cursor: pointer`
  Update README.md
This commit is contained in:
Fabien Potencier 2016-10-19 15:38:53 -07:00
commit a01cc6d8c4
8 changed files with 13 additions and 12 deletions

View File

@ -39,7 +39,7 @@ Running Symfony Tests
Information on how to run the Symfony test suite can be found in the Information on how to run the Symfony test suite can be found in the
[Running Symfony Tests][6] section. [Running Symfony Tests][6] section.
[1]: https://symfony.com/get_started [1]: https://symfony.com/doc/current/quick_tour/index.html
[2]: https://symfony.com/doc/current/ [2]: https://symfony.com/doc/current/
[3]: https://symfony.com/doc/current/contributing/code/index.html [3]: https://symfony.com/doc/current/contributing/code/index.html
[4]: https://symfony.com/doc/current/contributing/code/patches.html#check-list [4]: https://symfony.com/doc/current/contributing/code/patches.html#check-list

View File

@ -37,7 +37,7 @@ class SearchAndRenderBlockNode extends \Twig_Node_Expression_Function
// the variables in the third argument // the variables in the third argument
$label = $arguments[1]; $label = $arguments[1];
$variables = isset($arguments[2]) ? $arguments[2] : null; $variables = isset($arguments[2]) ? $arguments[2] : null;
$lineno = $label->getLine(); $lineno = $label->getTemplateLine();
if ($label instanceof \Twig_Node_Expression_Constant) { if ($label instanceof \Twig_Node_Expression_Constant) {
// If the label argument is given as a constant, we can either // If the label argument is given as a constant, we can either

View File

@ -109,18 +109,18 @@ class TransNode extends \Twig_Node
preg_match_all('/(?<!%)%([^%]+)%/', $msg, $matches); preg_match_all('/(?<!%)%([^%]+)%/', $msg, $matches);
foreach ($matches[1] as $var) { foreach ($matches[1] as $var) {
$key = new \Twig_Node_Expression_Constant('%'.$var.'%', $body->getLine()); $key = new \Twig_Node_Expression_Constant('%'.$var.'%', $body->getTemplateLine());
if (!$vars->hasElement($key)) { if (!$vars->hasElement($key)) {
if ('count' === $var && $this->hasNode('count')) { if ('count' === $var && $this->hasNode('count')) {
$vars->addElement($this->getNode('count'), $key); $vars->addElement($this->getNode('count'), $key);
} else { } else {
$varExpr = new \Twig_Node_Expression_Name($var, $body->getLine()); $varExpr = new \Twig_Node_Expression_Name($var, $body->getTemplateLine());
$varExpr->setAttribute('ignore_strict_check', $ignoreStrictCheck); $varExpr->setAttribute('ignore_strict_check', $ignoreStrictCheck);
$vars->addElement($varExpr, $key); $vars->addElement($varExpr, $key);
} }
} }
} }
return array(new \Twig_Node_Expression_Constant(str_replace('%%', '%', trim($msg)), $body->getLine()), $vars); return array(new \Twig_Node_Expression_Constant(str_replace('%%', '%', trim($msg)), $body->getTemplateLine()), $vars);
} }
} }

View File

@ -50,10 +50,10 @@ class TranslationDefaultDomainNodeVisitor extends \Twig_BaseNodeVisitor
return $node; return $node;
} else { } else {
$var = $env->getParser()->getVarName(); $var = $env->getParser()->getVarName();
$name = new \Twig_Node_Expression_AssignName($var, $node->getLine()); $name = new \Twig_Node_Expression_AssignName($var, $node->getTemplateLine());
$this->scope->set('domain', new \Twig_Node_Expression_Name($var, $node->getLine())); $this->scope->set('domain', new \Twig_Node_Expression_Name($var, $node->getTemplateLine()));
return new \Twig_Node_Set(false, new \Twig_Node(array($name)), new \Twig_Node(array($node->getNode('expr'))), $node->getLine()); return new \Twig_Node_Set(false, new \Twig_Node(array($name)), new \Twig_Node(array($node->getNode('expr'))), $node->getTemplateLine());
} }
} }
@ -71,7 +71,7 @@ class TranslationDefaultDomainNodeVisitor extends \Twig_BaseNodeVisitor
} else { } else {
if (!$arguments->hasNode($ind)) { if (!$arguments->hasNode($ind)) {
if (!$arguments->hasNode($ind - 1)) { if (!$arguments->hasNode($ind - 1)) {
$arguments->setNode($ind - 1, new \Twig_Node_Expression_Array(array(), $node->getLine())); $arguments->setNode($ind - 1, new \Twig_Node_Expression_Array(array(), $node->getTemplateLine()));
} }
$arguments->setNode($ind, $this->scope->get('domain')); $arguments->setNode($ind, $this->scope->get('domain'));

View File

@ -64,7 +64,7 @@ class TransChoiceTokenParser extends TransTokenParser
$body = $this->parser->subparse(array($this, 'decideTransChoiceFork'), true); $body = $this->parser->subparse(array($this, 'decideTransChoiceFork'), true);
if (!$body instanceof \Twig_Node_Text && !$body instanceof \Twig_Node_Expression) { if (!$body instanceof \Twig_Node_Text && !$body instanceof \Twig_Node_Expression) {
throw new \Twig_Error_Syntax('A message inside a transchoice tag must be a simple text.', $body->getLine(), $stream->getSourceContext()->getName()); throw new \Twig_Error_Syntax('A message inside a transchoice tag must be a simple text.', $body->getTemplateLine(), $stream->getSourceContext()->getName());
} }
$stream->expect(\Twig_Token::BLOCK_END_TYPE); $stream->expect(\Twig_Token::BLOCK_END_TYPE);

View File

@ -64,7 +64,7 @@ class TransTokenParser extends \Twig_TokenParser
$body = $this->parser->subparse(array($this, 'decideTransFork'), true); $body = $this->parser->subparse(array($this, 'decideTransFork'), true);
if (!$body instanceof \Twig_Node_Text && !$body instanceof \Twig_Node_Expression) { if (!$body instanceof \Twig_Node_Text && !$body instanceof \Twig_Node_Expression) {
throw new \Twig_Error_Syntax('A message inside a trans tag must be a simple text.', $body->getLine(), $stream->getSourceContext()->getName()); throw new \Twig_Error_Syntax('A message inside a trans tag must be a simple text.', $body->getTemplateLine(), $stream->getSourceContext()->getName());
} }
$stream->expect(\Twig_Token::BLOCK_END_TYPE); $stream->expect(\Twig_Token::BLOCK_END_TYPE);

View File

@ -133,6 +133,7 @@ button {
outline: none; outline: none;
border: 0; border: 0;
padding: 0; padding: 0;
cursor: pointer;
} }
.btn-link:hover { .btn-link:hover {
text-decoration: underline; text-decoration: underline;

View File

@ -761,7 +761,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
* @param int $traversalStrategy The strategy used for * @param int $traversalStrategy The strategy used for
* traversing the value * traversing the value
* @param GroupSequence $groupSequence The group sequence * @param GroupSequence $groupSequence The group sequence
* @param string[]|null $cascadedGroup The group that should * @param string|null $cascadedGroup The group that should
* be passed to cascaded * be passed to cascaded
* objects instead of * objects instead of
* the group sequence * the group sequence