halnique/php-slack-api

View on GitHub
src/WebAPI/Endpoints/WithAuthenticate.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Halnique\Slack\WebAPI\Endpoints;


trait WithAuthenticate
{
    public function token(): string
    {
        $token = getenv('SLACK_API_ACCESS_TOKEN');

        if ($token === false) {
            throw new \RuntimeException('Require Slack Api Access Token to set env: SLACK_API_ACCESS_TOKEN');
        }

        return $token;
    }
}