ppshobi / psonic

Sonic is a super fast auto suggestion engine built by the team at crisp.chat, a customer engagement platform. its built in Rust and they officially support a javascript client, but if you want to use sonic via php, this is the library that you can look for. Completely unit tested, and adheres to modern coding standards, and offers a clean api to interact with sonic.
MIT License
130 stars 9 forks source link

Without $password for Psonic/Client #5

Closed sergsoares closed 5 years ago

sergsoares commented 5 years ago

Inside Api-Docs

<?php

$search = new Psonic/Search(new Psonic/Client($host, $port, $password, $timeout));
echo $search->connect();

But in Client.php, this construct signature.

public function __construct($host = 'localhost', $port = 1491, $timeout = 30)

Some specific reason for help in this case ?

ppshobi commented 5 years ago

Well... That's a mistake, let me fix it ASAP. Actually the $password is not as part of the client instantiation, rather we supply the password with the StartChannel command, https://github.com/ppshobi/psonic/blob/ad9467677ea34028e36c515d50aa618f156872dc/src/Control.php#L31

But the tests were good because the default password is supplied as the default argument,

https://github.com/ppshobi/psonic/blob/ad9467677ea34028e36c515d50aa618f156872dc/src/Commands/Control/StartControlChannelCommand.php#L16

Thanks for pointing it out :)