setToken($token, $tokenSecret); } public static function createAuth(): ?string { $codebird = Codebird::getInstance(); $reply = $codebird->oauth_requestToken([ 'oauth_callback' => 'oob', ]); if(!$reply) return null; self::setToken($reply->oauth_token, $reply->oauth_token_secret); return $codebird->oauth_authorize(); } public static function completeAuth(string $pin): array { $reply = Codebird::getInstance()->oauth_accessToken([ 'oauth_verifier' => $pin, ]); if(!$reply) return []; self::setToken($reply->oauth_token, $reply->oauth_token_secret); return [ 'token' => $reply->oauth_token, 'token_secret' => $reply->oauth_token_secret, ]; } public static function sendTweet(string $text): void { Codebird::getInstance()->statuses_update([ 'status' => $text, ]); } }