[2.3] Remove most refs uses
This commit is contained in:
parent
e64b75f7d3
commit
88627058c9
|
@ -117,8 +117,10 @@ class DoctrineDataCollector extends DataCollector
|
|||
private function sanitizeQuery($connectionName, $query)
|
||||
{
|
||||
$query['explainable'] = true;
|
||||
$query['params'] = (array) $query['params'];
|
||||
foreach ($query['params'] as $j => &$param) {
|
||||
if (!is_array($query['params'])) {
|
||||
$query['params'] = array($query['params']);
|
||||
}
|
||||
foreach ($query['params'] as $j => $param) {
|
||||
if (isset($query['types'][$j])) {
|
||||
// Transform the param according to the type
|
||||
$type = $query['types'][$j];
|
||||
|
@ -131,7 +133,7 @@ class DoctrineDataCollector extends DataCollector
|
|||
}
|
||||
}
|
||||
|
||||
list($param, $explainable) = $this->sanitizeParam($param);
|
||||
list($query['params'][$j], $explainable) = $this->sanitizeParam($param);
|
||||
if (!$explainable) {
|
||||
$query['explainable'] = false;
|
||||
}
|
||||
|
|
|
@ -36,13 +36,13 @@ class TwigExtension extends Extension
|
|||
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
||||
$loader->load('twig.xml');
|
||||
|
||||
foreach ($configs as &$config) {
|
||||
foreach ($configs as $key => $config) {
|
||||
if (isset($config['globals'])) {
|
||||
foreach ($config['globals'] as $name => $value) {
|
||||
if (is_array($value) && isset($value['key'])) {
|
||||
$config['globals'][$name] = array(
|
||||
$configs[$key]['globals'][$name] = array(
|
||||
'key' => $name,
|
||||
'value' => $config['globals'][$name],
|
||||
'value' => $value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,9 @@ class FormatterHelper extends Helper
|
|||
*/
|
||||
public function formatBlock($messages, $style, $large = false)
|
||||
{
|
||||
$messages = (array) $messages;
|
||||
if (!is_array($messages)) {
|
||||
$messages = array($messages);
|
||||
}
|
||||
|
||||
$len = 0;
|
||||
$lines = array();
|
||||
|
@ -56,15 +58,15 @@ class FormatterHelper extends Helper
|
|||
}
|
||||
|
||||
$messages = $large ? array(str_repeat(' ', $len)) : array();
|
||||
foreach ($lines as $line) {
|
||||
$messages[] = $line.str_repeat(' ', $len - $this->strlen($line));
|
||||
for ($i = 0; isset($lines[$i]); ++$i) {
|
||||
$messages[] = $lines[$i].str_repeat(' ', $len - $this->strlen($lines[$i]));
|
||||
}
|
||||
if ($large) {
|
||||
$messages[] = str_repeat(' ', $len);
|
||||
}
|
||||
|
||||
foreach ($messages as &$message) {
|
||||
$message = sprintf('<%s>%s</%s>', $style, $message, $style);
|
||||
for ($i = 0; isset($messages[$i]); ++$i) {
|
||||
$messages[$i] = sprintf('<%s>%s</%s>', $style, $messages[$i], $style);
|
||||
}
|
||||
|
||||
return implode("\n", $messages);
|
||||
|
|
|
@ -997,9 +997,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|||
public function resolveServices($value)
|
||||
{
|
||||
if (is_array($value)) {
|
||||
foreach ($value as &$v) {
|
||||
$v = $this->resolveServices($v);
|
||||
}
|
||||
$value = array_map(array($this, 'resolveServices'), $value);
|
||||
} elseif ($value instanceof Reference) {
|
||||
$value = $this->get((string) $value, $value->getInvalidBehavior());
|
||||
} elseif ($value instanceof Definition) {
|
||||
|
|
Reference in New Issue