Passed
Push — develop ( 5be444...00a003 )
by Vasil
01:33
created

examples/Client/sync-request-arguments.php (1 issue)

Labels
Severity
1
<?php
2
use PEAR2\Net\RouterOS;
3
4
require_once 'PEAR2/Autoload.php';
5
6
try {
7
    $client = new RouterOS\Client('192.168.88.1', 'admin', 'password');
8
} catch (Exception $e) {
9
    die('Unable to connect to the router.');
10
}
11
12
$addRequest = new RouterOS\Request('/ip/arp/add');
13
14
$addRequest->setArgument('address', '192.168.88.100');
15
$addRequest->setArgument('mac-address', '00:00:00:00:00:01');
16
if ($client->sendSync($addRequest)->getType() !== Response::TYPE_FINAL) {
0 ignored issues
show
The type Response was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
17
    die("Error when creating ARP entry for '192.168.0.100'");
18
}
19
20
$addRequest->setArgument('address', '192.168.88.101');
21
$addRequest->setArgument('mac-address', '00:00:00:00:00:02');
22
if ($client->sendSync($addRequest)->getType() !== Response::TYPE_FINAL) {
23
    die("Error when creating ARP entry for '192.168.0.101'");
24
}
25
26
echo 'OK';
27