public function login($login, $api_key)
    {
        if (empty($login) || !is_string($login)) {
            throw new \InvalidArgumentException('Argument "login" cannot be empty and must be a string');
        }

        if (empty($login) || !is_string($api_key)) {
            throw new \InvalidArgumentException('Argument "api_key" cannot be empty and must be a string');
        }

        $this->auth = [
            'login'         => $login,
            'password_hash' => $api_key,
        ];
    }
public function login($login, $api_key)
    {
        if (empty($login) || !is_string($login)) {
            throw new \InvalidArgumentException('Argument "login" cannot be empty and must be a string');
        }

        if (empty($login) || !is_string($api_key)) {
            throw new \InvalidArgumentException('Argument "api_key" cannot be empty and must be a string');
        }

        $this->auth = [
            'login'         => $login,
            'password_hash' => $api_key,
        ];
    }
public function login ( $ login , $ api_key ) { if ( empty ( $ login ) || ! is_string ( $ login ) ) { throw new \ InvalidArgumentException ( 'Argument "login" cannot be empty and must be a string' ) ; } if ( empty ( $ login ) || ! is_string ( $ api_key ) ) { throw new \ InvalidArgumentException ( 'Argument "api_key" cannot be empty and must be a string' ) ; } $ this -> auth = [ 'login' => $ login , 'password_hash' => $ api_key , ] ; }
Set login data globally

@param $login
@param $api_key

@throws \InvalidArgumentException
Set login data globally