<?php
 namespace League\OAuth2\Client\OptionProvider; use League\OAuth2\Client\Provider\AbstractProvider; use League\OAuth2\Client\Tool\QueryBuilderTrait; class PostAuthOptionProvider implements OptionProviderInterface { use QueryBuilderTrait; public function getAccessTokenOptions($method, array $params) { $options = ['headers' => ['content-type' => 'application/x-www-form-urlencoded']]; if ($method === AbstractProvider::METHOD_POST) { $options['body'] = $this->getAccessTokenBody($params); } return $options; } protected function getAccessTokenBody(array $params) { return $this->buildQueryString($params); } } 