Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Removed deprecations in Templating component #14150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 0 additions & 52 deletions src/Symfony/Bundle/FrameworkBundle/Templating/Debugger.php

This file was deleted.

30 changes: 0 additions & 30 deletions src/Symfony/Component/Templating/DebuggerInterface.php

This file was deleted.

8 changes: 1 addition & 7 deletions src/Symfony/Component/Templating/Loader/FilesystemLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,12 @@ public function load(TemplateReferenceInterface $template)
if (is_file($file = strtr($templatePathPattern, $replacements)) && is_readable($file)) {
if (null !== $this->logger) {
$this->logger->debug('Loaded template file.', array('file' => $file));
} elseif (null !== $this->debugger) {
// just for BC, to be removed in 3.0
$this->debugger->log(sprintf('Loaded template file "%s".', $file));
}

return new FileStorage($file);
}

if (null !== $this->logger || null !== $this->debugger) {
if (null !== $this->logger) {
$fileFailures[] = $file;
}
}
Expand All @@ -82,9 +79,6 @@ public function load(TemplateReferenceInterface $template)
foreach ($fileFailures as $file) {
if (null !== $this->logger) {
$this->logger->debug('Failed loading template file.', array('file' => $file));
} elseif (null !== $this->debugger) {
// just for BC, to be removed in 3.0
$this->debugger->log(sprintf('Failed loading template file "%s".', $file));
}
}

Expand Down
20 changes: 0 additions & 20 deletions src/Symfony/Component/Templating/Loader/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\Templating\Loader;

use Psr\Log\LoggerInterface;
use Symfony\Component\Templating\DebuggerInterface;

/**
* Loader is the base class for all template loader classes.
Expand All @@ -26,11 +25,6 @@ abstract class Loader implements LoaderInterface
*/
protected $logger;

/**
* @deprecated since version 2.4, to be removed in 3.0. Use $this->logger instead.
*/
protected $debugger;

/**
* Sets the debug logger to use for this loader.
*
Expand All @@ -40,18 +34,4 @@ public function setLogger(LoggerInterface $logger)
{
$this->logger = $logger;
}

/**
* Sets the debugger to use for this loader.
*
* @param DebuggerInterface $debugger A debugger instance
*
* @deprecated since version 2.4, to be removed in 3.0. Use $this->setLogger() instead.
*/
public function setDebugger(DebuggerInterface $debugger)
{
trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0. Use the setLogger() method instead.', E_USER_DEPRECATED);

$this->debugger = $debugger;
}
}
13 changes: 0 additions & 13 deletions src/Symfony/Component/Templating/Tests/Loader/LoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,6 @@ public function testGetSetLogger()
$loader->setLogger($logger);
$this->assertSame($logger, $loader->getLogger(), '->setLogger() sets the logger instance');
}

/**
* @group legacy
*/
public function testLegacyGetSetDebugger()
{
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);

$loader = new ProjectTemplateLoader4();
$debugger = $this->getMock('Symfony\Component\Templating\DebuggerInterface');
$loader->setDebugger($debugger);
$this->assertSame($debugger, $loader->getDebugger(), '->setDebugger() sets the debugger instance');
}
}

class ProjectTemplateLoader4 extends Loader
Expand Down