Skip to content

Commit f53672f

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: Revert "bug symfony#21436 [DependencyInjection] check for circular refs caused by method calls (xabbuh)" Static code analysis with Php Inspections (EA Extended) [VarDumper] Added missing persistent stream cast
2 parents e103e1d + 68d6415 commit f53672f

File tree

23 files changed

+41
-84
lines changed

23 files changed

+41
-84
lines changed

src/Symfony/Bridge/Twig/Extension/CodeExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function fileExcerpt($file, $line)
138138
$code = @highlight_file($file, true);
139139
// remove main code/span tags
140140
$code = preg_replace('#^<code.*?>\s*<span.*?>(.*)</span>\s*</code>#s', '\\1', $code);
141-
$content = preg_split('#<br />#', $code);
141+
$content = explode('<br />', $code);
142142

143143
$lines = array();
144144
for ($i = max($line - 3, 1), $max = min($line + 3, count($content)); $i <= $max; ++$i) {

src/Symfony/Bridge/Twig/Tests/Extension/HttpKernelExtensionTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ protected function getFragmentHandler($return)
6262

6363
$context->expects($this->any())->method('getCurrentRequest')->will($this->returnValue(Request::create('/')));
6464

65-
$renderer = new FragmentHandler($context, array($strategy), false);
66-
67-
return $renderer;
65+
return new FragmentHandler($context, array($strategy), false);
6866
}
6967

7068
protected function renderTemplate(FragmentHandler $renderer, $template = '{{ render("foo") }}')

src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function fileExcerpt($file, $line)
132132
$code = @highlight_file($file, true);
133133
// remove main code/span tags
134134
$code = preg_replace('#^<code.*?>\s*<span.*?>(.*)</span>\s*</code>#s', '\\1', $code);
135-
$content = preg_split('#<br />#', $code);
135+
$content = explode('<br />', $code);
136136

137137
$lines = array();
138138
for ($i = max($line - 3, 1), $max = min($line + 3, count($content)); $i <= $max; ++$i) {

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@
4646

4747
<?php echo $view['translator']->trans('typecast', ['a' => (int) '123'], 'not_messages'); ?>
4848
<?php echo $view['translator']->transChoice('msg1', 10 + 1, [], 'not_messages'); ?>
49-
<?php echo $view['translator']->transChoice('msg2', intval(4.5), [], 'not_messages'); ?>
49+
<?php echo $view['translator']->transChoice('msg2', ceil(4.5), [], 'not_messages'); ?>

src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SimpleFormFactory.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,4 @@ protected function createListener($container, $id, $config, $userProvider)
7777

7878
return $listenerId;
7979
}
80-
81-
protected function createEntryPoint($container, $id, $config, $defaultEntryPoint)
82-
{
83-
$entryPointId = 'security.authentication.form_entry_point.'.$id;
84-
$container
85-
->setDefinition($entryPointId, new DefinitionDecorator('security.authentication.form_entry_point'))
86-
->addArgument(new Reference('security.http_utils'))
87-
->addArgument($config['login_path'])
88-
->addArgument($config['use_forward'])
89-
;
90-
91-
return $entryPointId;
92-
}
9380
}

src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ public function __construct()
6464
new RemoveUnusedDefinitionsPass(),
6565
)),
6666
new CheckExceptionOnInvalidReferenceBehaviorPass(),
67-
new CheckCircularReferencesPass(),
6867
);
6968
}
7069

src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -113,30 +113,4 @@ public function testProcessInlinesWhenThereAreMultipleReferencesButFromTheSameDe
113113
$this->assertFalse($container->hasDefinition('b'));
114114
$this->assertFalse($container->hasDefinition('c'), 'Service C was not inlined.');
115115
}
116-
117-
/**
118-
* @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException
119-
*/
120-
public function testCircularReferencesCausedByMethodCallsAreDetectedDuringCompilation()
121-
{
122-
$container = new ContainerBuilder();
123-
$container->setResourceTracking(false);
124-
125-
$container
126-
->register('foobar', '\stdClass')
127-
->addArgument(new Reference('foo'))
128-
;
129-
130-
$container
131-
->register('foo', '\stdClass')
132-
->addArgument(new Reference('bar'))
133-
;
134-
135-
$container
136-
->register('foo', '\stdClass')
137-
->addMethodCall('addFoobar', array(new Reference('foobar')))
138-
;
139-
140-
$container->compile();
141-
}
142116
}

src/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testCrossCheck($fixture, $type)
3636

3737
$tmp = tempnam(sys_get_temp_dir(), 'sf');
3838

39-
file_put_contents($tmp, file_get_contents(self::$fixturesPath.'/'.$type.'/'.$fixture));
39+
copy(self::$fixturesPath.'/'.$type.'/'.$fixture, $tmp);
4040

4141
$container1 = new ContainerBuilder();
4242
$loader1 = new $loaderClass($container1, new FileLocator());

src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container9.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
;
6464
$container
6565
->register('baz', 'Baz')
66+
->addMethodCall('setFoo', array(new Reference('foo_with_inline')))
6667
;
6768
$container
6869
->register('request', 'Request')

src/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services9.dot

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@ digraph sc {
3737
node_method_call1 -> node_foobaz [label="setBar()" style="dashed"];
3838
node_foo_with_inline -> node_inlined [label="setBar()" style="dashed"];
3939
node_inlined -> node_baz [label="setBaz()" style="dashed"];
40+
node_baz -> node_foo_with_inline [label="setFoo()" style="dashed"];
4041
node_configurator_service -> node_baz [label="setFoo()" style="dashed"];
4142
}

0 commit comments

Comments
 (0)