From 23730ab1005ca1e760dcdfbd7d853e6c3f1035d6 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 6 Jun 2020 14:11:37 +0200 Subject: [PATCH] Unpin version for symfony/polyfill-intl-idn (#2678) * Unpin version for symfony/polyfill-intl-idn * minor * typo * Added changelgo --- CHANGELOG.md | 4 ++++ composer.json | 2 +- src/Utils.php | 9 ++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5b183a0c..683c55946 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 6.5.5 - UNRELEASED + +* Unpin version constraint for `symfony/polyfill-intl-idn` [#2678](https://github.com/guzzle/guzzle/pull/2678) + ## 6.5.4 - 2020-05-25 * Fix various intl icu issues [#2626](https://github.com/guzzle/guzzle/pull/2626) diff --git a/composer.json b/composer.json index b7bff79a8..c01864f01 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "require": { "php": ">=5.5", "ext-json": "*", - "symfony/polyfill-intl-idn": "1.17.0", + "symfony/polyfill-intl-idn": "^1.17.0", "guzzlehttp/promises": "^1.0", "guzzlehttp/psr7": "^1.6.1" }, diff --git a/src/Utils.php b/src/Utils.php index dd90c2265..c698acbf0 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -81,9 +81,12 @@ private static function idnToAsci($domain, $options, &$info = []) } /* - * The Idn class is marked as @internal. We've locked the version to - * symfony/polyfill-intl-idn to avoid issues in the future. + * The Idn class is marked as @internal. Verify that class and method exists. */ - return Idn::idn_to_ascii($domain, $options, Idn::INTL_IDNA_VARIANT_UTS46, $info); + if (method_exists(Idn::class, 'idn_to_ascii')) { + return Idn::idn_to_ascii($domain, $options, Idn::INTL_IDNA_VARIANT_UTS46, $info); + } + + throw new \RuntimeException('ext-intl or symfony/polyfill-intl-idn not loaded or too old'); } }