Skip to content

Commit 643fcf2

Browse files
committed
Update
1 parent d12e6d2 commit 643fcf2

File tree

5 files changed

+8
-12
lines changed

5 files changed

+8
-12
lines changed

src/ErrorController.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,13 @@ public function __construct(int $code = 404, string $error = null, bool $render
4242
$file = $this->applyFilter('error-template', '/system/error');
4343
$error = $this->applyFilter('error', $this->translate($error));
4444

45-
Response::setHttpHeaders($code, $type);
45+
Response::setHttpHeader($code, $type);
4646
$this->render($file, [
4747
'status' => $message,
4848
'code' => $code,
4949
'error' => $error
5050
]);
51-
52-
die();
51+
exit();
5352

5453
} else {
5554

src/Middleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function dispatch() : void
8080
$this->throwError(404);
8181
}
8282

83-
if ( !Debugger::enabled() ) die();
83+
if ( !Debugger::enabled() ) exit();
8484
}
8585

8686
/**

src/Orm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ public function setup() : bool
602602
return (bool)$query->execute();
603603

604604
} catch (PDOException $e) {
605-
die("ERROR : {$e->getMessage()}");
605+
exit("ERROR : {$e->getMessage()}");
606606
}
607607
}
608608

src/TraitConfiguration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ public function __construct()
4444
*/
4545
public function __clone()
4646
{
47-
die(__METHOD__ . ': Clone denied');
47+
exit(__METHOD__ . ': Clone denied');
4848
}
4949

5050
/**
5151
* Prevent object serialization.
5252
*/
5353
public function __wakeup()
5454
{
55-
die(__METHOD__ . ': Unserialize denied');
55+
exit(__METHOD__ . ': Unserialize denied');
5656
}
5757

5858
/**

src/View.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ protected function setContent(array $content = []) : void
7272
public function render(string $file = 'default', array $content = [], bool $end = false) : void
7373
{
7474
echo $this->assign($file, $content);
75-
if ( $end ) die;
75+
if ( $end ) exit;
7676
}
7777

7878
/**
@@ -104,7 +104,7 @@ public function assign(string $file = 'default', array $content = []) : string
104104

105105
} catch (\Exception | \RuntimeException $e) {
106106
if ( $this->isDebug() ) {
107-
die($e->getMessage());
107+
exit($e->getMessage());
108108
}
109109
$this->clearLastError();
110110
}
@@ -124,9 +124,6 @@ protected function getDefaultCallables() : array
124124
'dump' => function ($var) : void {
125125
var_dump($var);
126126
},
127-
'die' => function (?string $string = null) : never {
128-
die($string);
129-
},
130127
'isDebug' => function () : bool {
131128
return $this->isDebug();
132129
},

0 commit comments

Comments
 (0)