Skip to content

Commit 66a862e

Browse files
Majkl578dg
authored andcommitted
SnippetBridge: Remove IRenderable check (Control is always IRenderable) (#139)
1 parent 0248f1f commit 66a862e

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

src/Bridges/ApplicationLatte/SnippetBridge.php

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,20 @@ public function addSnippet($name, $content)
7070

7171
public function renderChildren()
7272
{
73-
if ($this->control instanceof IRenderable) {
74-
$queue = [$this->control];
75-
do {
76-
foreach (array_shift($queue)->getComponents() as $child) {
77-
if ($child instanceof IRenderable) {
78-
if ($child->isControlInvalid()) {
79-
$child->snippetMode = TRUE;
80-
$child->render();
81-
$child->snippetMode = FALSE;
82-
}
83-
} elseif ($child instanceof Nette\ComponentModel\IContainer) {
84-
$queue[] = $child;
73+
$queue = [$this->control];
74+
do {
75+
foreach (array_shift($queue)->getComponents() as $child) {
76+
if ($child instanceof IRenderable) {
77+
if ($child->isControlInvalid()) {
78+
$child->snippetMode = TRUE;
79+
$child->render();
80+
$child->snippetMode = FALSE;
8581
}
82+
} elseif ($child instanceof Nette\ComponentModel\IContainer) {
83+
$queue[] = $child;
8684
}
87-
} while ($queue);
88-
}
85+
}
86+
} while ($queue);
8987
}
9088

9189
}

0 commit comments

Comments
 (0)