Skip to content

Commit

Permalink
Resolved conflicts with 6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
gmponos committed Dec 18, 2019
2 parents d56612f + 2eda2b9 commit a5a84c3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 48 deletions.
4 changes: 2 additions & 2 deletions docs/request-options.rst
Expand Up @@ -554,14 +554,14 @@ http_errors


idn_conversion
---
--------------

:Summary: Internationalized Domain Name (IDN) support (enabled by default if
``intl`` extension is available).
:Types:
- bool
- int
:Default: ``true`` if ``intl`` extension is available, ``false`` otherwise
:Default: ``true`` if ``intl`` extension is available (and ICU library is 4.6+ for PHP 7.2+), ``false`` otherwise
:Constant: ``GuzzleHttp\RequestOptions::IDN_CONVERSION``

.. code-block:: php
Expand Down
42 changes: 1 addition & 41 deletions phpstan-baseline.neon
Expand Up @@ -16,7 +16,7 @@ parameters:
path: src/Client.php

-
message: "#^Method GuzzleHttp\\\\Client\\:\\:__call\\(\\) should return GuzzleHttp\\\\Promise\\\\PromiseInterface but returns GuzzleHttp\\\\PromiseInterface\\|Psr\\\\Http\\\\Message\\\\ResponseInterface\\.$#"
message: "#^Method GuzzleHttp\\\\Client\\:\\:__call\\(\\) should return GuzzleHttp\\\\Promise\\\\PromiseInterface but returns GuzzleHttp\\\\Promise\\\\PromiseInterface\\|Psr\\\\Http\\\\Message\\\\ResponseInterface\\.$#"
count: 1
path: src/Client.php

Expand All @@ -25,16 +25,6 @@ parameters:
count: 1
path: src/Client.php

-
message: "#^Return typehint of method GuzzleHttp\\\\Client\\:\\:sendAsync\\(\\) has invalid type GuzzleHttp\\\\PromiseInterface\\.$#"
count: 1
path: src/Client.php

-
message: "#^Method GuzzleHttp\\\\Client\\:\\:sendAsync\\(\\) should return GuzzleHttp\\\\PromiseInterface but returns GuzzleHttp\\\\Promise\\\\PromiseInterface\\.$#"
count: 1
path: src/Client.php

-
message: "#^Method GuzzleHttp\\\\Client\\:\\:send\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
count: 1
Expand All @@ -45,26 +35,11 @@ parameters:
count: 2
path: src/Client.php

-
message: "#^Call to method wait\\(\\) on an unknown class GuzzleHttp\\\\PromiseInterface\\.$#"
count: 2
path: src/Client.php

-
message: "#^Method GuzzleHttp\\\\Client\\:\\:requestAsync\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
count: 1
path: src/Client.php

-
message: "#^Return typehint of method GuzzleHttp\\\\Client\\:\\:requestAsync\\(\\) has invalid type GuzzleHttp\\\\PromiseInterface\\.$#"
count: 1
path: src/Client.php

-
message: "#^Method GuzzleHttp\\\\Client\\:\\:requestAsync\\(\\) should return GuzzleHttp\\\\PromiseInterface but returns GuzzleHttp\\\\Promise\\\\PromiseInterface\\.$#"
count: 1
path: src/Client.php

-
message: "#^Method GuzzleHttp\\\\Client\\:\\:request\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
count: 1
Expand Down Expand Up @@ -1125,16 +1100,6 @@ parameters:
count: 1
path: src/Pool.php

-
message: "#^Return typehint of method GuzzleHttp\\\\Pool\\:\\:promise\\(\\) has invalid type GuzzleHttp\\\\GuzzleHttp\\\\Promise\\\\Promise\\.$#"
count: 1
path: src/Pool.php

-
message: "#^Method GuzzleHttp\\\\Pool\\:\\:promise\\(\\) should return GuzzleHttp\\\\GuzzleHttp\\\\Promise\\\\Promise but returns GuzzleHttp\\\\Promise\\\\PromiseInterface\\.$#"
count: 1
path: src/Pool.php

-
message: "#^Method GuzzleHttp\\\\Pool\\:\\:batch\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
count: 1
Expand All @@ -1155,11 +1120,6 @@ parameters:
count: 1
path: src/Pool.php

-
message: "#^Call to method wait\\(\\) on an unknown class GuzzleHttp\\\\GuzzleHttp\\\\Promise\\\\Promise\\.$#"
count: 1
path: src/Pool.php

-
message: "#^Method GuzzleHttp\\\\Pool\\:\\:cmpCallback\\(\\) has parameter \\$name with no typehint specified\\.$#"
count: 1
Expand Down
13 changes: 10 additions & 3 deletions src/Client.php
Expand Up @@ -102,7 +102,7 @@ public function __call($method, $args)
* @param array $options Request options to apply to the given
* request and to the transfer. See \GuzzleHttp\RequestOptions.
*
* @return PromiseInterface
* @return Promise\PromiseInterface
*/
public function sendAsync(RequestInterface $request, array $options = [])
{
Expand Down Expand Up @@ -142,7 +142,7 @@ public function send(RequestInterface $request, array $options = [])
* @param string|UriInterface $uri URI object or string.
* @param array $options Request options to apply. See \GuzzleHttp\RequestOptions.
*
* @return PromiseInterface
* @return Promise\PromiseInterface
*/
public function requestAsync($method, $uri = '', array $options = [])
{
Expand Down Expand Up @@ -240,7 +240,14 @@ private function configureDefaults(array $config)
];

// idn_to_ascii() is a part of ext-intl and might be not available
$defaults['idn_conversion'] = function_exists('idn_to_ascii');
$defaults['idn_conversion'] = function_exists('idn_to_ascii')
// Old ICU versions don't have this constant, so we are basically stuck (see https://github.com/guzzle/guzzle/pull/2424
// and https://github.com/guzzle/guzzle/issues/2448 for details)
&& (
defined('INTL_IDNA_VARIANT_UTS46')
||
PHP_VERSION_ID < 70200
);

// Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set.

Expand Down
4 changes: 3 additions & 1 deletion src/Pool.php
Expand Up @@ -2,6 +2,7 @@
namespace GuzzleHttp;

use GuzzleHttp\Promise\EachPromise;
use GuzzleHttp\Promise\PromiseInterface;
use GuzzleHttp\Promise\PromisorInterface;
use Psr\Http\Message\RequestInterface;

Expand Down Expand Up @@ -71,7 +72,8 @@ public function __construct(

/**
* Get promise
* @return GuzzleHttp\Promise\Promise
*
* @return PromiseInterface
*/
public function promise()
{
Expand Down
3 changes: 2 additions & 1 deletion src/functions.php
Expand Up @@ -358,7 +358,8 @@ function _current_time()
function _idn_uri_convert(UriInterface $uri, $options = 0)
{
if ($uri->getHost()) {
$asciiHost = idn_to_ascii($uri->getHost(), $options, INTL_IDNA_VARIANT_UTS46, $info);
$idnaVariant = defined('INTL_IDNA_VARIANT_UTS46') ? INTL_IDNA_VARIANT_UTS46 : 0;
$asciiHost = idn_to_ascii($uri->getHost(), $options, $idnaVariant, $info);
if ($asciiHost === false) {
$errorBitSet = isset($info['errors']) ? $info['errors'] : 0;

Expand Down

0 comments on commit a5a84c3

Please sign in to comment.