Skip to content

Commit

Permalink
ContainerBuilder: create_function() replaced with eval()
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Mar 17, 2017
1 parent 9e332a0 commit aa72c5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DI/ContainerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ public function formatStatement(Statement $statement)
foreach ($this->definitions[$service]->parameters as $k => $v) {
$params[] = preg_replace('#\w+\z#', '\$$0', (is_int($k) ? $v : $k)) . (is_int($k) ? '' : ' = ' . PhpHelpers::dump($v));
}
$rm = new \ReflectionFunction(create_function(implode(', ', $params), ''));
$rm = new \ReflectionFunction(eval('return function(' . implode(', ', $params) . ') {};'));
$arguments = Helpers::autowireArguments($rm, $arguments, $this);
return $this->formatPhp('$this->?(?*)', array(Container::getMethodName($service), $arguments));

Expand Down

0 comments on commit aa72c5c

Please sign in to comment.