Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c22d783

Browse filesBrowse files
committed
[Form] Add useDefaultThemes flag to the interfaces
1 parent b935b93 commit c22d783
Copy full SHA for c22d783

File tree

5 files changed

+10
-11
lines changed
Filter options

5 files changed

+10
-11
lines changed

‎UPGRADE-4.0.md

Copy file name to clipboardExpand all lines: UPGRADE-4.0.md
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,8 @@ Form
326326
}
327327
```
328328

329+
* `FormRendererInterface::setTheme` and `FormRendererEngineInterface::setTheme` have a new optional argument `$useDefaultThemes` with a default value set to `true`.
330+
329331
FrameworkBundle
330332
---------------
331333

‎src/Symfony/Component/Form/AbstractRendererEngine.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/AbstractRendererEngine.php
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,13 @@ public function __construct(array $defaultThemes = array())
6262
/**
6363
* {@inheritdoc}
6464
*/
65-
public function setTheme(FormView $view, $themes /*, $useDefaultThemes = true */)
65+
public function setTheme(FormView $view, $themes, $useDefaultThemes = true)
6666
{
6767
$cacheKey = $view->vars[self::CACHE_KEY_VAR];
6868

6969
// Do not cast, as casting turns objects into arrays of properties
7070
$this->themes[$cacheKey] = is_array($themes) ? $themes : array($themes);
71-
72-
$args = func_get_args();
73-
$this->useDefaultThemes[$cacheKey] = isset($args[2]) ? (bool) $args[2] : true;
71+
$this->useDefaultThemes[$cacheKey] = (bool) $useDefaultThemes;
7472

7573
// Unset instead of resetting to an empty array, in order to allow
7674
// implementations (like TwigRendererEngine) to check whether $cacheKey

‎src/Symfony/Component/Form/FormRenderer.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/FormRenderer.php
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,9 @@ public function getEngine()
7070
/**
7171
* {@inheritdoc}
7272
*/
73-
public function setTheme(FormView $view, $themes /*, $useDefaultThemes = true */)
73+
public function setTheme(FormView $view, $themes, $useDefaultThemes = true)
7474
{
75-
$args = func_get_args();
76-
$this->engine->setTheme($view, $themes, isset($args[2]) ? (bool) $args[2] : true);
75+
$this->engine->setTheme($view, $themes, $useDefaultThemes);
7776
}
7877

7978
/**

‎src/Symfony/Component/Form/FormRendererEngineInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/FormRendererEngineInterface.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ interface FormRendererEngineInterface
2525
* @param mixed $themes The theme(s). The type of these themes
2626
* is open to the implementation.
2727
* @param bool $useDefaultThemes If true, will use default themes specified
28-
* in the engine, will be added to the interface in 4.0
28+
* in the engine
2929
*/
30-
public function setTheme(FormView $view, $themes /*, $useDefaultThemes = true */);
30+
public function setTheme(FormView $view, $themes, $useDefaultThemes = true);
3131

3232
/**
3333
* Returns the resource for a block name.

‎src/Symfony/Component/Form/FormRendererInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/FormRendererInterface.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ public function getEngine();
3232
* @param mixed $themes The theme(s). The type of these themes
3333
* is open to the implementation.
3434
* @param bool $useDefaultThemes If true, will use default themes specified
35-
* in the renderer, will be added to the interface in 4.0
35+
* in the renderer
3636
*/
37-
public function setTheme(FormView $view, $themes /*, $useDefaultThemes = true */);
37+
public function setTheme(FormView $view, $themes, $useDefaultThemes = true);
3838

3939
/**
4040
* Renders a named block of the form theme.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.