Skip to content

Commit 8fb996f

Browse files
committed
ISnippetBridge: added typehints
1 parent 3f06d04 commit 8fb996f

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"nette/utils": "to use filter |webalize"
3030
},
3131
"conflict": {
32-
"nette/application": "<2.4.1"
32+
"nette/application": "<3.0"
3333
},
3434
"autoload": {
3535
"classmap": ["src/"]

src/Latte/Runtime/ISnippetBridge.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
*/
1717
interface ISnippetBridge
1818
{
19-
function isSnippetMode();
19+
function isSnippetMode(): bool;
2020

21-
function setSnippetMode($snippetMode);
21+
function setSnippetMode(bool $snippetMode);
2222

23-
function needsRedraw($name);
23+
function needsRedraw(string $name): bool;
2424

25-
function markRedrawn($name);
25+
function markRedrawn(string $name): void;
2626

27-
function getHtmlId($name);
27+
function getHtmlId(string $name): string;
2828

29-
function addSnippet($name, $content);
29+
function addSnippet(string $name, string $content): void;
3030

31-
function renderChildren();
31+
function renderChildren(): void;
3232
}

tests/Latte/mocks/SnippetBridge.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,33 @@ public function isSnippetMode(): bool
1818
}
1919

2020

21-
public function setSnippetMode($snippetMode)
21+
public function setSnippetMode(bool $snippetMode)
2222
{
2323
$this->snippetMode = $snippetMode;
2424
}
2525

2626

27-
public function needsRedraw($name): bool
27+
public function needsRedraw(string $name): bool
2828
{
2929
return $this->invalid === true || isset($this->invalid[$name]);
3030
}
3131

3232

33-
public function markRedrawn($name): void
33+
public function markRedrawn(string $name): void
3434
{
3535
if ($this->invalid !== true) {
3636
unset($this->invalid[$name]);
3737
}
3838
}
3939

4040

41-
public function getHtmlId($name): string
41+
public function getHtmlId(string $name): string
4242
{
4343
return $name;
4444
}
4545

4646

47-
public function addSnippet($name, $content): void
47+
public function addSnippet(string $name, string $content): void
4848
{
4949
$this->payload[$name] = $content;
5050
}

0 commit comments

Comments
 (0)