From 5521e03471426179e11a06c73f1e995502b4af01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Backhaus?= Date: Sat, 1 Aug 2020 09:02:27 +0200 Subject: [PATCH] Added return and argument type for LoaderInterface --- doc/recipes.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/recipes.rst b/doc/recipes.rst index 76f81bbd4..6b97d66a7 100644 --- a/doc/recipes.rst +++ b/doc/recipes.rst @@ -400,7 +400,7 @@ Now, let's define a loader able to use this database:: $this->dbh = $dbh; } - public function getSourceContext($name) + public function getSourceContext(string $name): Source { if (false === $source = $this->getValue('source', $name)) { throw new \Twig\Error\LoaderError(sprintf('Template "%s" does not exist.', $name)); @@ -409,17 +409,17 @@ Now, let's define a loader able to use this database:: return new \Twig\Source($source, $name); } - public function exists($name) + public function exists(string $name) { return $name === $this->getValue('name', $name); } - public function getCacheKey($name) + public function getCacheKey(string $name): string { return $name; } - public function isFresh($name, $time) + public function isFresh(string $name, int $time): bool { if (false === $lastModified = $this->getValue('last_modified', $name)) { return false;