QueryBuilderTrait.php 903 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * This file is part of the league/oauth2-client library
  4. *
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. *
  8. * @copyright Copyright (c) Alex Bilbie <hello@alexbilbie.com>
  9. * @license http://opensource.org/licenses/MIT MIT
  10. * @link http://thephpleague.com/oauth2-client/ Documentation
  11. * @link https://packagist.org/packages/league/oauth2-client Packagist
  12. * @link https://github.com/thephpleague/oauth2-client GitHub
  13. */
  14. namespace League\OAuth2\Client\Tool;
  15. /**
  16. * Provides a standard way to generate query strings.
  17. */
  18. trait QueryBuilderTrait
  19. {
  20. /**
  21. * Build a query string from an array.
  22. *
  23. * @param array $params
  24. *
  25. * @return string
  26. */
  27. protected function buildQueryString(array $params)
  28. {
  29. return http_build_query($params, '', '&', \PHP_QUERY_RFC3986);
  30. }
  31. }