This project only includes the route GET /has_permission/{token}
which has to decide if the provided token exists and has the required permission.
Your task is to refactor the endpoint and create tests, if necessary.
- php 8.1
- composer
$ composer install
$ php src/main.php
Expected output:
[INFO] Registering GET /has_permission/{token}
[INFO] Server running on 127.0.0.1:1337
$ php vendor/bin/phpunit Test