1
0
Fork 0
mirror of synced 2024-06-29 03:30:34 +12:00

feat(template): fix incorrect if condition

This commit is contained in:
Christy Jacob 2021-07-23 23:16:03 +05:30
parent 2919e70d05
commit e6e0baab12

View file

@ -22,7 +22,7 @@ class Template extends View
*/ */
public static function fromFile(string $path): self public static function fromFile(string $path): self
{ {
if (\is_readable($path)) { if (!\is_readable($path)) {
throw new Exception("$path view template is not readable."); throw new Exception("$path view template is not readable.");
} }
@ -51,7 +51,7 @@ class Template extends View
if (empty($html)) { if (empty($html)) {
throw new Exception('Empty HTML string'); throw new Exception('Empty HTML string');
} }
$template = new Template(); $template = new Template();
return $template->setHtml($html); return $template->setHtml($html);
} }