diff --git a/composer.json b/composer.json index 77c0094..d476c3c 100755 --- a/composer.json +++ b/composer.json @@ -30,7 +30,10 @@ "autoload": { "psr-4": { "Rudra\\Exceptions\\" : "src/" - } + }, + "files": [ + "src/helpers.php" + ] }, "autoload-dev": { "psr-4": { diff --git a/src/helpers.php b/src/helpers.php new file mode 100644 index 0000000..1798f50 --- /dev/null +++ b/src/helpers.php @@ -0,0 +1,16 @@ + + * @license https://mit-license.org/ MIT + */ + +use Rudra\Exceptions\RouterException; + +if (!function_exists('abort')) { + function abort(int $code): void + { + throw new RouterException($code); + } +} +