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