Skip to content

Commit

Permalink
Merge branch '2.5' into 2.6
Browse files Browse the repository at this point in the history
* 2.5:
  [Form] fixed a maxlength overring on a guessing
  [Debug] Show only unique class candidates
  [SecurityBundle] Firewall providers building - code cleaning
  [Filesystem] symlink use RealPath instead LinkTarget
  [DependencyInjection] Remove duplicate  declaration in PhpDumper
  terminals are not interactive on Travis
  Revert "[DependencyInjection] backport perf optim"
  [WebProfilerBundle] replaced pattern to path attribute in routes definitions.
  fix phpdoc's alignment
  Fixed the AuthenticationProviderInterface alignment
  Fixed the proxy-manager version constraint
  [FrameworkBundle][Template name] avoid  error message for the shortcut notation.
  [DependencyInjection] perf optim: call dirname() at most 5x
  [DependencyInjection] backport perf optim
  Fixed #12845 adding a listener to an event that is currently being dispatched will not result into a fatal error in TraceableEventDispatcher [EventDispatcher]
  [2.5] Remove possible call_user_func()
  [2.3] Remove possible call_user_func()

Conflicts:
	src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
	src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php
	src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php
	src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services11.php
	src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services12.php
	src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php
	src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php
  • Loading branch information
nicolas-grekas committed Dec 12, 2014
2 parents 2b17676 + b349eea commit 66f45ad
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Definition/Builder/ExprBuilder.php
Expand Up @@ -225,8 +225,10 @@ public static function buildExpressions(array $expressions)
{
foreach ($expressions as $k => $expr) {
if ($expr instanceof ExprBuilder) {
$expressions[$k] = function ($v) use ($expr) {
return call_user_func($expr->ifPart, $v) ? call_user_func($expr->thenPart, $v) : $v;
$if = $expr->ifPart;
$then = $expr->thenPart;
$expressions[$k] = function ($v) use ($if, $then) {
return $if($v) ? $then($v) : $v;
};
}
}
Expand Down
4 changes: 3 additions & 1 deletion Definition/VariableNode.php
Expand Up @@ -49,7 +49,9 @@ public function hasDefaultValue()
*/
public function getDefaultValue()
{
return $this->defaultValue instanceof \Closure ? call_user_func($this->defaultValue) : $this->defaultValue;
$v = $this->defaultValue;

return $v instanceof \Closure ? $v() : $v;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Exception/FileLoaderImportCircularReferenceException.php
Expand Up @@ -22,6 +22,6 @@ public function __construct(array $resources, $code = null, $previous = null)
{
$message = sprintf('Circular reference detected in "%s" ("%s" > "%s").', $this->varToString($resources[0]), implode('" > "', $resources), $resources[0]);

call_user_func('Exception::__construct', $message, $code, $previous);
\Exception::__construct($message, $code, $previous);
}
}

0 comments on commit 66f45ad

Please sign in to comment.