Close #109 provide better error classes + phpdoc fixes
This commit is contained in:
@ -16,6 +16,8 @@ use Da\User\Query\UserQuery;
|
||||
use Da\User\Traits\ContainerAwareTrait;
|
||||
use Da\User\Traits\ModuleAwareTrait;
|
||||
use Yii;
|
||||
use yii\base\Exception;
|
||||
use yii\base\InvalidConfigException;
|
||||
use yii\base\InvalidParamException;
|
||||
use yii\base\NotSupportedException;
|
||||
use yii\behaviors\TimestampBehavior;
|
||||
@ -74,6 +76,8 @@ class User extends ActiveRecord implements IdentityInterface
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @throws InvalidParamException
|
||||
* @throws InvalidConfigException
|
||||
* @throws Exception
|
||||
*/
|
||||
public function beforeSave($insert)
|
||||
{
|
||||
@ -98,6 +102,8 @@ class User extends ActiveRecord implements IdentityInterface
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*
|
||||
* @throws InvalidConfigException
|
||||
*/
|
||||
public function afterSave($insert, $changedAttributes)
|
||||
{
|
||||
@ -242,6 +248,7 @@ class User extends ActiveRecord implements IdentityInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws InvalidConfigException
|
||||
* @return bool whether the user is an admin or not
|
||||
*/
|
||||
public function getIsAdmin()
|
||||
@ -271,6 +278,8 @@ class User extends ActiveRecord implements IdentityInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws InvalidConfigException
|
||||
* @throws InvalidParamException
|
||||
* @return \yii\db\ActiveQuery
|
||||
*/
|
||||
public function getProfile()
|
||||
@ -285,7 +294,7 @@ class User extends ActiveRecord implements IdentityInterface
|
||||
*/
|
||||
public function getSocialNetworkAccounts()
|
||||
{
|
||||
if ($this->connectedAccounts == null) {
|
||||
if (null === $this->connectedAccounts) {
|
||||
/** @var SocialNetworkAccount[] $accounts */
|
||||
$accounts = $this->hasMany(
|
||||
$this->getClassMap()
|
||||
|
||||
Reference in New Issue
Block a user