8000 [WebProfilerBundle] Remove deprecated TemplateManager::getTemplates() by maidmaid · Pull Request #23427 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[WebProfilerBundle] Remove deprecated TemplateManager::getTemplates() #23427

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

Merged
merged 1 commit into from
Jul 6, 2017
Merged
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
Remove TemplateManager::getTemplates()
  • Loading branch information
maidmaid committed Jul 6, 2017
commit f8be69da5f6aa3a93ae153ec1e383ae11c913068
5 changes: 5 additions & 0 deletions UPGRADE-4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,11 @@ VarDumper
VarDumperTestTrait::assertDumpMatchesFormat($dump, $data, $filter = 0, $message = '');
```

WebProfilerBundle
-----------------

* Removed the `getTemplates()` method of the `TemplateManager` class in favor of the ``getNames()`` method.

Workflow
--------

Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CHANGELOG
-----

* removed the `WebProfilerExtension::dumpValue()` method
* removed the `getTemplates()` method of the `TemplateManager` class in favor of the ``getNames()`` method

3.1.0
-----
Expand Down
20 changes: 0 additions & 20 deletions src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,6 @@ public function getName(Profile $profile, $panel)
return $templates[$panel];
}

/**
* Gets the templates for a given profile.
*
* @param Profile $profile
*
* @return Template[]
*
* @deprecated not used anymore internally
*/
public function getTemplates(Profile $profile)
{
$templates = $this->getNames($profile);

foreach ($templates as $name => $template) {
$templates[$name] = $this->twig->loadTemplate($template);
}

return $templates;
}

/**
* Gets template names of templates that are present in the viewed profile.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,28 +79,6 @@ public function testGetNameValidTemplate()
$this->assertEquals('FooBundle:Collector:foo.html.twig', $this->templateManager->getName($profile, 'foo'));
}

/**
* template should be loaded for 'foo' because other collectors are
* missing in profile or in profiler.
*/
public function testGetTemplates()
{
$profile = $this->mockProfile();
$profile->expects($this->any())
->method('hasCollector')
->will($this->returnCallback(array($this, 'profilerHasCallback')));

$this->profiler->expects($this->any())
->method('has')
->withAnyParameters()
->will($this->returnCallback(array($this, 'profileHasCollectorCallback')));

$result = $this->templateManager->getTemplates($profile);
$this->assertArrayHasKey('foo', $result);
$this->assertArrayNotHasKey('bar', $result);
$this->assertArrayNotHasKey('baz', $result);
}

public function profilerHasCallback($panel)
{
switch ($panel) {
Expand Down
0