Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in constructor #2

Open
ottodriver opened this issue Sep 2, 2024 · 2 comments
Open

Bug in constructor #2

ottodriver opened this issue Sep 2, 2024 · 2 comments

Comments

@ottodriver
Copy link

ottodriver commented Sep 2, 2024

Param $key should be named $options to be able to invoque it with an array of options

    public function __construct(**$options**, $debug=0)
    {
        if (is_string($key)) {
            $options = [
                'apiKey' => $key,
                'debugLevel' => isset($debug) ? $debug : 0,
            ];
        }
        if (!empty($options['server'])) $this->server = $options['server'];
        if (!empty($options['apiKey'])) $this->apiKey = $options['apiKey'];
        if (!empty($options['debugLevel'])) $this->debugLevel = $options['debugLevel'];
        if (!empty($options['defaultTimeout'])) $this->defaultTimeout = $options['defaultTimeout'];
        if (!empty($options['recaptchaTimeout'])) $this->recaptchaTimeout = $options['recaptchaTimeout'];
        if (!empty($options['pollingInterval'])) $this->pollingInterval = $options['pollingInterval'];
        $this->apiClient = new ApiClient($this->server);
    }
@p3le
Copy link

p3le commented Sep 4, 2024

@ottodriver I just logged in to report same thing but you were first.

Also would be nice to override appId param in constructor for method wrapAttachDefaultParams, because for now it is hardcoded to 8C9E51E4-7D28-4DC8-AD15-E2C1B211EE4F

@ottodriver
Copy link
Author

@ottodriver I just logged in to report same thing but you were first.

Also would be nice to override appId param in constructor for method wrapAttachDefaultParams, because for now it is hardcoded to 8C9E51E4-7D28-4DC8-AD15-E2C1B211EE4F

That (appId) is intentional ;), you need to patch it with a post install script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants