Close #109 provide better error classes + phpdoc fixes
This commit is contained in:
@ -51,6 +51,7 @@ class AssignmentsWidget extends Widget
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @throws InvalidParamException
|
||||
* @throws InvalidConfigException
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
|
||||
@ -15,6 +15,7 @@ use Yii;
|
||||
use yii\authclient\ClientInterface;
|
||||
use yii\authclient\widgets\AuthChoice;
|
||||
use yii\authclient\widgets\AuthChoiceAsset;
|
||||
use yii\base\InvalidParamException;
|
||||
use yii\helpers\Html;
|
||||
use yii\helpers\Url;
|
||||
|
||||
@ -40,6 +41,8 @@ class ConnectWidget extends AuthChoice
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @throws InvalidParamException
|
||||
*/
|
||||
public function createClientUrl($provider)
|
||||
{
|
||||
@ -59,6 +62,6 @@ class ConnectWidget extends AuthChoice
|
||||
*/
|
||||
public function isConnected(ClientInterface $provider)
|
||||
{
|
||||
return $this->accounts != null && isset($this->accounts[$provider->getId()]);
|
||||
return null !== $this->accounts && isset($this->accounts[$provider->getId()]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,6 +49,8 @@ class ReCaptchaWidget extends InputWidget
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*
|
||||
* @throws InvalidConfigException
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
@ -78,6 +80,7 @@ class ReCaptchaWidget extends InputWidget
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws InvalidConfigException
|
||||
* @return array the google recaptcha options.
|
||||
*/
|
||||
protected function getCaptchaOptions()
|
||||
@ -156,7 +159,7 @@ class ReCaptchaWidget extends InputWidget
|
||||
'pt-PT'
|
||||
];
|
||||
|
||||
return in_array($language, $except)
|
||||
return in_array($language, $except, false)
|
||||
? $language
|
||||
: substr($language, 0, strpos($language, '-'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user