From 1677120cae979ab2e005bf3030e429df2821dcaf Mon Sep 17 00:00:00 2001 From: Elias Luhr Date: Tue, 19 Mar 2024 16:25:49 +0100 Subject: [PATCH] Fix #387: Use appropriate exception if client does not exist --- CHANGELOG.md | 2 +- src/Collection.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a66273..a11eec4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ Yii Framework 2 authclient extension Change Log 2.2.16 under development ------------------------ -- no changes in this release. +- Enh #387: Use appropriate exception if client does not exist (eluhr) 2.2.15 December 16, 2023 diff --git a/src/Collection.php b/src/Collection.php index 01d95aa..0d0d74d 100644 --- a/src/Collection.php +++ b/src/Collection.php @@ -8,7 +8,7 @@ namespace yii\authclient; use yii\base\Component; -use yii\base\InvalidParamException; +use yii\base\InvalidArgumentException; use Yii; /** @@ -81,12 +81,12 @@ public function getClients() /** * @param string $id service id. * @return ClientInterface auth client instance. - * @throws InvalidParamException on non existing client request. + * @throws InvalidArgumentException on non existing client request. */ public function getClient($id) { if (!array_key_exists($id, $this->_clients)) { - throw new InvalidParamException("Unknown auth client '{$id}'."); + throw new InvalidArgumentException("Unknown auth client '{$id}'."); } if (!is_object($this->_clients[$id])) { $this->_clients[$id] = $this->createClient($id, $this->_clients[$id]);