public function validForUpdate($user, array $credentials)
    {
        if ($user instanceof UserInterface)
        {
            $user = $user->getUserId();
        }

        return $this->validate($credentials, $user);
    }
public function validForUpdate($user, array $credentials)
    {
        if ($user instanceof UserInterface)
        {
            $user = $user->getUserId();
        }

        return $this->validate($credentials, $user);
    }
public function validForUpdate ( $ user , array $ credentials ) { if ( $ user instanceof UserInterface ) { $ user = $ user -> getUserId ( ) ; } return $ this -> validate ( $ credentials , $ user ) ; }
Validate if the given user is valid for updating.

@param  UserInterface|int $user
@param  array             $credentials
@return bool
@throws \InvalidArgumentException
Validate if the given user is valid for updating .