Skip to content
Permalink
Browse files

ISnippetBridge: added typehints

  • Loading branch information
dg committed Feb 20, 2019
1 parent d8216f3 commit ccc694250cbda3d06cc62c1edbec360b4dc1cefb
Showing with 13 additions and 13 deletions.
  1. +1 −1 composer.json
  2. +7 −7 src/Latte/Runtime/ISnippetBridge.php
  3. +5 −5 tests/Latte/mocks/SnippetBridge.php
@@ -31,7 +31,7 @@
"nette/utils": "to use filter |webalize"
},
"conflict": {
"nette/application": "<2.4.1"
"nette/application": "<3.0"
},
"autoload": {
"classmap": ["src/"]
@@ -16,17 +16,17 @@
*/
interface ISnippetBridge
{
function isSnippetMode();
function isSnippetMode(): bool;

function setSnippetMode($snippetMode);
function setSnippetMode(bool $snippetMode);

function needsRedraw($name);
function needsRedraw(string $name): bool;

function markRedrawn($name);
function markRedrawn(string $name): void;

function getHtmlId($name);
function getHtmlId(string $name): string;

function addSnippet($name, $content);
function addSnippet(string $name, string $content): void;

function renderChildren();
function renderChildren(): void;
}
@@ -18,33 +18,33 @@ public function isSnippetMode(): bool
}
public function setSnippetMode($snippetMode)
public function setSnippetMode(bool $snippetMode)
{
$this->snippetMode = $snippetMode;
}
public function needsRedraw($name): bool
public function needsRedraw(string $name): bool
{
return $this->invalid === true || isset($this->invalid[$name]);
}
public function markRedrawn($name): void
public function markRedrawn(string $name): void
{
if ($this->invalid !== true) {
unset($this->invalid[$name]);
}
}
public function getHtmlId($name): string
public function getHtmlId(string $name): string
{
return $name;
}
public function addSnippet($name, $content): void
public function addSnippet(string $name, string $content): void
{
$this->payload[$name] = $content;
}

0 comments on commit ccc6942

Please sign in to comment.
You can’t perform that action at this time.