Skip to content

Conversation

@yuri-kovalev
Copy link

public $partner;

public function __construct( $idInstance, $apiTokenInstance, $host = "https://api.green-api.com", $media = "https://media.green-api.com" ) {
public function __construct( $idInstance = null, $apiTokenInstance = null, $partnerToken = null, $host = "https://api.green-api.com", $media = "https://media.green-api.com" ) {
Copy link
Author

@yuri-kovalev yuri-kovalev Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any way php support named arguments from 8 version
new GreenApiClient(idInstance: 'idInstance', apiTokenInstance: 'apiTokenInstance', partnerToken: 'partnerToken')

$this->statuses = new Statuses( $this );
$this->partnerToken = $partnerToken;

if ($this->idInstance && $this->apiTokenInstance) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this, but for partner API there is no need to use idInstance and apiTokenInstance because we may not have them.

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

Successfully merging this pull request may close these issues.

1 participant