From a954718a7b6a3bd2b4e45f776b7c46bbc4312f98 Mon Sep 17 00:00:00 2001 From: Ben Croker Date: Wed, 16 Oct 2024 13:25:04 +0200 Subject: [PATCH] Add `end` method --- composer.json | 2 +- src/DatastarResponse.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 84175f8..3766438 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "putyourlightson/datastar-php", "description": "A set of PHP helper classes for working with Datastar.", - "version": "0.0.1", + "version": "0.0.3", "type": "library", "license": "mit", "require": { diff --git a/src/DatastarResponse.php b/src/DatastarResponse.php index e453d98..521e9f9 100644 --- a/src/DatastarResponse.php +++ b/src/DatastarResponse.php @@ -47,4 +47,12 @@ public function sendEvent(DatastarEvent $event): void ob_flush(); flush(); } + + /** + * Ends the request. + */ + public function end(): void + { + exit(); + } }