Skip to content

Commit cb70c2f

Browse files
Merge branch '2.7' into 2.8
* 2.7: (36 commits) [DoctrineBridge] Bypass the db when no valid identifier is provided in ORMQueryBuilderLoader [Serializer] Fixed typo in comment [Form] Fixed: Filter non-integers when selecting entities by int ID Fix merge Fix merge Add test for HHVM FatalErrors [2.6][Debug] Fix fatal-errors handling on HHVM [Debug] Fix log level of stacked errors [VarDumper] Fix uninitialized id in HtmlDumper Fixed fluent interface [Console] Fix tests on Windows [2.7] Fix unsilenced deprecation notices [2.3][Debug] Fix fatal-errors handling on HHVM [Debug] fix debug class loader case test on windows Standardize the name of the exception variables [Debug+VarDumper] Fix handling of PHP7 exception/error model Do not trigger deprecation error in ResolveParameterPlaceHoldersPass [2.3] Static Code Analysis for Components Added a small Upgrade note regarding security.context added missing deprecation in CHANGELOG ... Conflicts: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig src/Symfony/Component/HttpKernel/Kernel.php
2 parents 3565308 + 9167a04 commit cb70c2f

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

Compiler/ResolveInvalidReferencesPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function process(ContainerBuilder $container)
4747
foreach ($definition->getMethodCalls() as $call) {
4848
try {
4949
$calls[] = array($call[0], $this->processArguments($call[1], true));
50-
} catch (RuntimeException $ignore) {
50+
} catch (RuntimeException $e) {
5151
// this call is simply removed
5252
}
5353
}
@@ -58,7 +58,7 @@ public function process(ContainerBuilder $container)
5858
try {
5959
$value = $this->processArguments(array($value), true);
6060
$properties[$name] = reset($value);
61-
} catch (RuntimeException $ignore) {
61+
} catch (RuntimeException $e) {
6262
// ignore property
6363
}
6464
}

Compiler/ResolveParameterPlaceHoldersPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function process(ContainerBuilder $container)
3838
$definition->setFile($parameterBag->resolveValue($definition->getFile()));
3939
$definition->setArguments($parameterBag->resolveValue($definition->getArguments()));
4040
if ($definition->getFactoryClass(false)) {
41-
$definition->setFactoryClass($parameterBag->resolveValue($definition->getFactoryClass()));
41+
$definition->setFactoryClass($parameterBag->resolveValue($definition->getFactoryClass(false)));
4242
}
4343

4444
$factory = $definition->getFactory();

ContainerBuilder.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,13 @@ public function createService(Definition $definition, $id, $tryProxy = true)
982982

983983
if ($callable = $definition->getConfigurator()) {
984984
if (is_array($callable)) {
985-
$callable[0] = $callable[0] instanceof Reference ? $this->get((string) $callable[0]) : $parameterBag->resolveValue($callable[0]);
985+
$callable[0] = $parameterBag->resolveValue($callable[0]);
986+
987+
if ($callable[0] instanceof Reference) {
988+
$callable[0] = $this->get((string) $callable[0], $callable[0]->getInvalidBehavior());
989+
} elseif ($callable[0] instanceof Definition) {
990+
$callable[0] = $this->createService($callable[0], null);
991+
}
986992
}
987993

988994
if (!is_callable($callable)) {

Dumper/GraphvizDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ private function addOptions($options)
278278
*/
279279
private function dotize($id)
280280
{
281-
return strtolower(preg_replace('/[^\w]/i', '_', $id));
281+
return strtolower(preg_replace('/\W/i', '_', $id));
282282
}
283283

284284
/**

Tests/ContainerBuilderTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,12 @@ public function testCreateServiceConfigurator()
405405
$builder->register('foo3', 'Bar\FooClass')->setConfigurator(array(new Reference('baz'), 'configure'));
406406
$this->assertTrue($builder->get('foo3')->configured, '->createService() calls the configurator');
407407

408-
$builder->register('foo4', 'Bar\FooClass')->setConfigurator('foo');
408+
$builder->register('foo4', 'Bar\FooClass')->setConfigurator(array($builder->getDefinition('baz'), 'configure'));
409+
$this->assertTrue($builder->get('foo4')->configured, '->createService() calls the configurator');
410+
411+
$builder->register('foo5', 'Bar\FooClass')->setConfigurator('foo');
409412
try {
410-
$builder->get('foo4');
413+
$builder->get('foo5');
411414
$this->fail('->createService() throws an InvalidArgumentException if the configure callable is not a valid callable');
412415
} catch (\InvalidArgumentException $e) {
413416
$this->assertEquals('The configure callable for class "Bar\FooClass" is not a callable.', $e->getMessage(), '->createService() throws an InvalidArgumentException if the configure callable is not a valid callable');

0 commit comments

Comments
 (0)