<commit_before>## Usage

### Controllers and middleware

Routes must be given a "stack". This is a list of services retrieved from the service container that the framework
will call in order. The last entry in the stack is the controller. All other services are referred to as "middleware".

There are no restrictions for what a controller or middleware looks like, but they must be `callable`. Typically this
is achieved by implementing the magic method `__invoke` on the controller class. No arguments are passed to the
controller or middleware when they are called.

The interfaces `QL\Panthor\ControllerInterface` and `QL\Panthor\MiddlewareInterface` are provided for convenience that
middleware and controllers may implement, but no type checks are performed.

The Bootstrap and RouteLoader will populate several **runtime services** that are available to be used as dependencies
for any service.

Service            | Description
------------------ | -----------
root               | The application root. NO TRAILING SLASH.
slim.environment   | Slim\Environment
slim.request       | Slim\Http\Request
slim.response      | Slim\Http\Response
slim.parameters    | An associative array of route parameters.
slim.halt          | A callable used to abort application execution.

About `slim.halt`:

Usually applications need a way to abort execution of the script. In the case of redirects, errors, or other situations
in which script execution should be terminated early.

This callable requires an http status code. Optionally, you can set the body of the http response. If not provided it
will be empty. Generally this should be avoided in client-facing applications.

Example usage:
```php
call_user_func($halt, 500, 'An unknown error occured');
```<commit_msg>Update usage docs<commit_after>## Usage

### Controllers and middleware

Routes must be given a "stack". This is a list of services retrieved from the service container that the framework
will call in order. The last entry in the stack is the controller. All other services are referred to as "middleware".

There are no restrictions for what a controller or middleware looks like, but they must be `callable`. Typically this
is achieved by implementing the magic method `__invoke` on the controller class. No arguments are passed to the
controller or middleware when they are called.

The interfaces `QL\Panthor\ControllerInterface` and `QL\Panthor\MiddlewareInterface` are provided for convenience that
middleware and controllers may implement, but no type checks are performed.

It is recommended applications import the panthor `di.yml` configuration file in their application `config.yml` file.

This configuration provides many boilerplates services.

Service                  | Description
------------------------ | -----------
root                     | The application root. NO TRAILING SLASH.
slim.environment         | Slim\Environment
slim.request             | Slim\Http\Request
slim.response            | Slim\Http\Response
slim.route               | Slim\Route - The matched Slim Route
slim.route.parameters    | An associative array of route parameters.
slim.halt                | An invokeable class used to abort application execution.
slim.not.found           | An invokeable class used to trigger Slim's Not Found functionality

About `slim.halt`:

Usually applications need a way to abort execution of the script. In the case of redirects, errors, or other situations
in which script execution should be terminated early.

This callable requires an http status code. Optionally, you can set the body of the http response. If not provided it
will be empty. Generally this should be avoided in client-facing applications.

Example usage:
```php
call_user_func($halt, 500, 'Internal Server Error');
```

About `slim.not.found`:

When invoked, this class will trigger Slim **Not Found**. It has the same behavior as `slim.halt` in that it halts further execution of the controller stack.

Example usage:
```php
call_user_func($notFound);
```
{'fraction_non_alphanumeric': 0.07004470938897168, 'fraction_numerical': 0.0014903129657228018, 'mean_word_length': 3.6022857142857143, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3338471', 'n_tokens_mistral': 992, 'n_tokens_neox': 946, 'n_words': 516}