8000 Merge branch '3.3' into 3.4 · symfony/symfony@531b294 · GitHub
[go: up one dir, main page]

Skip to content

Commit 531b294

Browse files
Merge branch '3.3' into 3.4
* 3.3: [DI] Remove unused props from the PhpDumper [VarDumper] Keep and reuse array stubs in memory [ProxyManager] Cleanup fixtures [Console][WebServerBundle] Use "exec" when possible [Debug] HTML-escape array key Add some phpdocs for IDE autocompletion and better SCA Fixed typo in docblock
2 parents f20b959 + 3088e0a commit 531b294

File tree

12 files changed

+82
-443
lines changed

12 files changed

+82
-443
lines changed

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Dumper/PhpDumperTest.php

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,9 @@ class PhpDumperTest extends TestCase
2727
{
2828
public function testDumpContainerWithProxyService()
2929
{
30-
$container = new ContainerBuilder();
31-
32-
$container->register('foo', 'stdClass');
33-
$container->getDefinition('foo')->setLazy(true);
34-
$container->compile();
35-
36-
$dumper = new PhpDumper($container);
37-
38-
$dumper->setProxyDumper(new ProxyDumper());
39-
40-
$dumpedString = $dumper->dump();
41-
4230
$this->assertStringMatchesFormatFile(
4331
__DIR__.'/../Fixtures/php/lazy_service_structure.txt',
44-
$dumpedString,
32+
$this->dumpLazyServiceProjectServiceContainer(),
4533
'->dump() does generate proxy lazy loading logic.'
4634
);
4735
}
@@ -51,17 +39,15 @@ public function testDumpContainerWithProxyService()
5139
*/
5240
public function testDumpContainerWithProxyServiceWillShareProxies()
5341
{
54-
if (class_exists(StaticProxyConstructor::class)) { // detecting ProxyManager v2
55-
require_once __DIR__.'/../Fixtures/php/lazy_service_with_hints.php';
56-
} else {
57-
require_once __DIR__.'/../Fixtures/php/lazy_service.php';
42+
if (!class_exists('LazyServiceProjectServiceContainer', false)) {
43+
eval('?>'.$this->dumpLazyServiceProjectServiceContainer());
5844
}
5945

6046
$container = new \LazyServiceProjectServiceContainer();
6147

62-
/* @var $proxy \stdClass_c1d194250ee2e2b7d2eab8b8212368a8 */
6348
$proxy = $container->get('foo');
64-
$this->assertInstanceOf('stdClass_c1d194250ee2e2b7d2eab8b8212368a8', $proxy);
49+
$this->assertInstanceOf('stdClass', $proxy);
50+
$this->assertInstanceOf('ProxyManager\Proxy\LazyLoadingInterface', $proxy);
6551
$this->assertSame($proxy, $container->get('foo'));
6652

6753
$this->assertFalse($proxy->isProxyInitialized());
@@ -71,4 +57,19 @@ public function testDumpContainerWithProxyServiceWillShareProxies()
7157
$this->assertTrue($proxy->isProxyInitialized());
7258
$this->assertSame($proxy, $container->get('foo'));
7359
}
60+
61+
private function dumpLazyServiceProjectServiceContainer()
62+
{
63+
$container = new ContainerBuilder();
64+
65+
$container->register('foo', 'stdClass');
66+
$container->getDefinition('foo')->setLazy(true);
67+
$container->compile();
68+
69+
$dumper = new PhpDumper($container);
70+
71+
$dumper->setProxyDumper(new ProxyDumper());
72+
73+
return $dumper->dump(array('class' => 'LazyServiceProjectServiceContainer'));
74+
}
7475
}

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service.php

Lines changed: 0 additions & 182 deletions
This file was deleted.

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service_structure.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
use %a
4-
class ProjectServiceContainer extends Container
4+
class LazyServiceProjectServiceContainer extends Container
55
{%a
66
public function getFooService($lazyLoad = true)
77
{

0 commit comments

Comments
 (0)
0