Skip to content

Commit f72a7c3

Browse files
committed
feature symfony#16107 [3.0] Various deprecations cleanups (nicolas-grekas)
This PR was merged into the 3.0-dev branch. Discussion ---------- [3.0] Various deprecations cleanups | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- 534a91c [3.0] Various deprecations cleanups
2 parents 8b15af9 + 534a91c commit f72a7c3

File tree

11 files changed

+3
-97
lines changed

11 files changed

+3
-97
lines changed

src/Symfony/Bundle/FrameworkBundle/DataCollector/AjaxDataCollector.php

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

src/Symfony/Bundle/FrameworkBundle/Resources/config/collectors.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
<tag name="data_collector" template="@WebProfiler/Collector/request.html.twig" id="request" priority="335" />
1616
</service>
1717

18-
<service id="data_collector.ajax" class="Symfony\Component\HttpKernel\DataCollector\AjaxDataCollector" public="false">
19-
<tag name="data_collector" template="@WebProfiler/Collector/ajax.html.twig" id="ajax" priority="315" />
20-
</service>
21-
2218
<service id="data_collector.exception" class="Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector" public="false">
2319
<tag name="data_collector" template="@WebProfiler/Collector/exception.html.twig" id="exception" priority="305" />
2420
</service>

src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,5 @@ public function process(ContainerBuilder $container)
7777
if ($container->has('assets.packages')) {
7878
$container->getDefinition('twig.extension.assets')->addTag('twig.extension');
7979
}
80-
81-
if (method_exists('Symfony\Bridge\Twig\AppVariable', 'setContainer')) {
82-
// we are on Symfony <3.0, where the setContainer method exists
83-
$container->getDefinition('twig.app_variable')->addMethodCall('setContainer', array(new Reference('service_container')));
84-
}
8580
}
8681
}

src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -116,27 +116,6 @@ public function panelAction(Request $request, $token)
116116
)), 200, array('Content-Type' => 'text/html'));
117117
}
118118

119-
/**
120-
* Purges all tokens.
121-
*
122-
* @return Response A Response instance
123-
*
124-
* @throws NotFoundHttpException
125-
*/
126-
public function purgeAction()
127-
{
128-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
129-
130-
if (null === $this->profiler) {
131-
throw new NotFoundHttpException('The profiler must be enabled.');
132-
}
133-
134-
$this->profiler->disable();
135-
$this->profiler->purge();
136-
137-
return new RedirectResponse($this->generator->generate('_profiler_info', array('about' => 'purge')), 302, array('Content-Type' => 'text/html'));
138-
}
139-
140119
/**
141120
* Displays information page.
142121
*

src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/profiler.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
<default key="_controller">web_profiler.controller.profiler:searchBarAction</default>
1717
</route>
1818

19-
<route id="_profiler_purge" path="/purge">
20-
<default key="_controller">web_profiler.controller.profiler:purgeAction</default>
21-
</route>
22-
2319
<route id="_profiler_info" path="/info/{about}">
2420
<default key="_controller">web_profiler.controller.profiler:infoAction</default>
2521
</route>

src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ private function parseDefinition(\DOMElement $service, $file)
221221
if (false !== strpos($name, '-') && false === strpos($name, '_') && !array_key_exists($normalizedName = str_replace('-', '_', $name), $parameters)) {
222222
$parameters[$normalizedName] = XmlUtils::phpize($node->nodeValue);
223223
}
224-
// keep not normalized key for BC too
224+
// keep not normalized key
225225
$parameters[$name] = XmlUtils::phpize($node->nodeValue);
226226
}
227227

src/Symfony/Component/DomCrawler/Crawler.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -901,12 +901,7 @@ private function relativize($xpath)
901901
$expression = substr($expression, strlen($parenthesis));
902902
}
903903

904-
// BC for Symfony 2.4 and lower were elements were adding in a fake _root parent
905-
if (0 === strpos($expression, '/_root/')) {
906-
@trigger_error('XPath expressions referencing the fake root node are deprecated since version 2.8 and will be unsupported in 3.0. Please use "./" instead of "/_root/".', E_USER_DEPRECATED);
907-
908-
$expression = './'.substr($expression, 7);
909-
} elseif (0 === strpos($expression, 'self::*/')) {
904+
if (0 === strpos($expression, 'self::*/')) {
910905
$expression = './'.substr($expression, 8);
911906
}
912907

@@ -921,12 +916,7 @@ private function relativize($xpath)
921916
$expression = 'self::'.substr($expression, 2);
922917
} elseif (0 === strpos($expression, 'child::')) {
923918
$expression = 'self::'.substr($expression, 7);
924-
} elseif ('/' === $expression[0] || 0 === strpos($expression, 'self::')) {
925-
// the only direct child in Symfony 2.4 and lower is _root, which is already handled previously
926-
// so let's drop the expression entirely
927-
$expression = $nonMatchingExpression;
928-
} elseif ('.' === $expression[0]) {
929-
// '.' is the fake root element in Symfony 2.4 and lower, which is excluded from results
919+
} elseif ('/' === $expression[0] || '.' === $expression[0] || 0 === strpos($expression, 'self::')) {
930920
$expression = $nonMatchingExpression;
931921
} elseif (0 === strpos($expression, 'descendant::')) {
932922
$expression = 'descendant-or-self::'.substr($expression, strlen('descendant::'));

src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -551,16 +551,6 @@ public function testFilterXPathWithFakeRoot()
551551
$this->assertCount(0, $crawler->filterXPath('self::_root'), '->filterXPath() returns an empty result if the XPath references the fake root node');
552552
}
553553

554-
/** @group legacy */
555-
public function testLegacyFilterXPathWithFakeRoot()
556-
{
557-
$crawler = $this->createTestCrawler();
558-
$this->assertCount(0, $crawler->filterXPath('/_root'), '->filterXPath() returns an empty result if the XPath references the fake root node');
559-
560-
$crawler = $this->createTestCrawler()->filterXPath('//body');
561-
$this->assertCount(1, $crawler->filterXPath('/_root/body'));
562-
}
563-
564554
public function testFilterXPathWithAncestorAxis()
565555
{
566556
$crawler = $this->createTestCrawler()->filterXPath('//form');

src/Symfony/Component/Form/Tests/AbstractFormTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ abstract class AbstractFormTest extends \PHPUnit_Framework_TestCase
3434

3535
protected function setUp()
3636
{
37-
// We need an actual dispatcher to use the deprecated
38-
// bindRequest() method
3937
$this->dispatcher = new EventDispatcher();
4038
$this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface');
4139
$this->form = $this->createForm();

src/Symfony/Component/Process/ProcessBuilder.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ public function getProcess()
268268
$script = implode(' ', array_map(array(__NAMESPACE__.'\\ProcessUtils', 'escapeArgument'), $arguments));
269269

270270
if ($this->inheritEnv) {
271-
// include $_ENV for BC purposes
272271
$env = array_replace($_ENV, $_SERVER, $this->env);
273272
} else {
274273
$env = $this->env;

0 commit comments

Comments
 (0)