Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace yii\authclient;

use yii\base\Component;
use yii\base\InvalidParamException;
use yii\base\InvalidArgumentException;
use Yii;

/**
Expand Down Expand Up @@ -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]);
Expand Down