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]);