Wipotec checkweigher client written in PHP.
Via Composer
$ composer require graze/wipotec-checkweigher-client
Use the factory
method to return a Client
instance:
$client = \Graze\WipotecCheckweigherClient\Client::factory();
...
Connect to the remote checkweigher using the connect
method:
...
$dsn = '127.0.0.1:55001';
$client->connect($dsn);
...
Once connected, the sendRequest
method can be used to send requests to the checkweigher:
...
$request = new \Graze\WipotecCheckweigherClient\Request\RequestSetArticle();
$request->setArticleParam(Parameter::NAME, $articleName);
$request->setArticleParam(Parameter::NUMBER, $articleNumber);
$response = $client->sendRequest($request);
...
If a corresponding response class exists (in \Graze\Wipotec\Response\
) for a request then it will be used, otherwise the ResponseGeneric
will be returned.
All responses have the following methods:
/**
* Whether an error was returned.
*
* @return bool
*/
public function hasError();
/**
* Get the error message.
*
* @return string
*/
public function getError();
/**
* Get the raw response as an array.
*
* @return mixed[]
*/
public function getContents();
Please see CHANGELOG for more information what has changed recently.
make build test
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.