Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 95b6c56

Browse filesBrowse files
committed
Merge branch '2.6' into 2.7
* 2.6: [Process] Fix outdated Process->start() docblock prevent inlining service configurators [DomCrawler] Improve namespace discovery performance Conflicts: src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php
2 parents 89cbafd + 99330cb commit 95b6c56
Copy full SHA for 95b6c56

File tree

Expand file treeCollapse file tree

6 files changed

+42
-10
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+42
-10
lines changed

‎src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ public function process(ContainerBuilder $container)
6262
$definition->setProperties(
6363
$this->inlineArguments($container, $definition->getProperties())
6464
);
65-
66-
$configurator = $this->inlineArguments($container, array($definition->getConfigurator()));
67-
$definition->setConfigurator($configurator[0]);
6865
}
6966
}
7067

‎src/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,23 @@ public function testProcessDoesNotInlineFactories()
254254
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $factory[0]);
255255
}
256256

257+
public function testProcessDoesNotInlineConfigurators()
258+
{
259+
$container = new ContainerBuilder();
260+
$container
261+
->register('foo.configurator')
262+
->setPublic(false)
263+
;
264+
$container
265+
->register('foo')
266+
->setConfigurator(array(new Reference('foo.configurator'), 'getFoo'))
267+
;
268+
$this->process($container);
269+
270+
$configurator = $container->getDefinition('foo')->getConfigurator();
271+
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $configurator[0]);
272+
}
273+
257274
protected function process(ContainerBuilder $container)
258275
{
259276
$repeatedPass = new RepeatedPass(array(new AnalyzeServiceReferencesPass(), new InlineServiceDefinitionsPass()));

‎src/Symfony/Component/DependencyInjection/Tests/Dumper/XmlDumperTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Dumper/XmlDumperTest.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ public function provideCompiledContainerData()
169169
{
170170
return array(
171171
array('container8'),
172+
array('container9'),
172173
array('container11'),
173174
array('container12'),
174175
array('container14'),

‎src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php
+23-4Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function __construct()
3737
$this->methodMap = array(
3838
'bar' => 'getBarService',
3939
'baz' => 'getBazService',
40+
'configurator_service' => 'getConfiguratorServiceService',
4041
'configured_service' => 'getConfiguredServiceService',
4142
'decorator_service' => 'getDecoratorServiceService',
4243
'decorator_service_with_name' => 'getDecoratorServiceWithNameService',
@@ -112,12 +113,9 @@ protected function getBazService()
112113
*/
113114
protected function getConfiguredServiceService()
114115
{
115-
$a = new \ConfClass();
116-
$a->setFoo($this->get('baz'));
117-
118116
$this->services['configured_service'] = $instance = new \stdClass();
119117

120-
$a->configureStdClass($instance);
118+
$this->get('configurator_service')->configureStdClass($instance);
121119

122120
return $instance;
123121
}
@@ -298,6 +296,27 @@ protected function getServiceFromStaticMethodService()
298296
return $this->services['service_from_static_method'] = \Bar\FooClass::getInstance();
299297
}
300298

299+
/**
300+
* Gets the 'configurator_service' service.
301+
*
302+
* This service is shared.
303+
* This method always returns the same instance of the service.
304+
*
305+
* This service is private.
306+
* If you want to be able to request this service from the container directly,
307+
* make it public, otherwise you might end up with broken code.
308+
*
309+
* @return \ConfClass A ConfClass instance.
310+
*/
311+
protected function getConfiguratorServiceService()
312+
{
313+
$this->services['configurator_service'] = $instance = new \ConfClass();
314+
315+
$instance->setFoo($this->get('baz'));
316+
317+
return $instance;
318+
}
319+
301320
/**
302321
* Gets the 'new_factory' service.
303322
*

‎src/Symfony/Component/DomCrawler/Crawler.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DomCrawler/Crawler.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ private function discoverNamespace(\DOMXPath $domxpath, $prefix)
10191019
*/
10201020
private function findNamespacePrefixes($xpath)
10211021
{
1022-
if (preg_match_all('/(?P<prefix>[a-z_][a-z_0-9\-\.]*):[^"\/]/i', $xpath, $matches)) {
1022+
if (preg_match_all('/(?P<prefix>[a-z_][a-z_0-9\-\.]*):[^"\/:]/i', $xpath, $matches)) {
10231023
return array_unique($matches['prefix']);
10241024
}
10251025

‎src/Symfony/Component/Process/Process.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Process/Process.php
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,6 @@ public function mustRun($callback = null)
254254
* @param callable|null $callback A PHP callback to run whenever there is some
255255
* output available on STDOUT or STDERR
256256
*
257-
* @return Process The process itself
258-
*
259257
* @throws RuntimeException When process can't be launched
260258
* @throws RuntimeException When process is already running
261259
* @throws LogicException In case a callback is provided and output has been disabled

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.