Skip to content

Commit 5ae6bc1

Browse files
committed
throwing exceptions from __toString() is allowed since PHP 7.4
1 parent d6dd226 commit 5ae6bc1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Application/UI/Link.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function __toString(): string
8989
return $this->component->link($this->destination, $this->params);
9090

9191
} catch (\Throwable $e) {
92-
if (func_num_args()) {
92+
if (func_num_args() || PHP_VERSION_ID >= 70400) {
9393
throw $e;
9494
}
9595
trigger_error('Exception in ' . __METHOD__ . "(): {$e->getMessage()} in {$e->getFile()}:{$e->getLine()}", E_USER_ERROR);

src/Bridges/ApplicationLatte/Template.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function __toString(): string
6969
try {
7070
return $this->latte->renderToString($this->file, $this->params);
7171
} catch (\Throwable $e) {
72-
if (func_num_args()) {
72+
if (func_num_args() || PHP_VERSION_ID >= 70400) {
7373
throw $e;
7474
}
7575
trigger_error('Exception in ' . __METHOD__ . "(): {$e->getMessage()} in {$e->getFile()}:{$e->getLine()}", E_USER_ERROR);

0 commit comments

Comments
 (0)