Skip to content

Commit bdb55d4

Browse files
committed
CS fixes.
1 parent e5705b1 commit bdb55d4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+790
-688
lines changed

examples/Util/add.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<?php
22
use PEAR2\Net\RouterOS;
3+
34
require_once 'PEAR2/Autoload.php';
45

5-
$util = new RouterOS\Util($client = new RouterOS\Client('192.168.88.1', 'admin', 'password'));
6+
$util = new RouterOS\Util(
7+
$client = new RouterOS\Client('192.168.88.1', 'admin', 'password')
8+
);
69
$util->setMenu('/ip arp');
710
$util->add(
811
array(
@@ -13,4 +16,4 @@
1316
'address' => '192.168.88.101',
1417
'mac-address' => '00:00:00:00:00:02'
1518
)
16-
);
19+
);

examples/Util/count.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<?php
22
use PEAR2\Net\RouterOS;
3+
34
require_once 'PEAR2/Autoload.php';
45

5-
$util = new RouterOS\Util($client = new RouterOS\Client('192.168.88.1', 'admin', 'password'));
6+
$util = new RouterOS\Util(
7+
$client = new RouterOS\Client('192.168.88.1', 'admin', 'password')
8+
);
69
$util->setMenu('/ip arp');
710

811
//With function
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<?php
22
use PEAR2\Net\RouterOS;
3+
34
require_once 'PEAR2/Autoload.php';
45

5-
$util = new RouterOS\Util($client = new RouterOS\Client('192.168.88.1', 'admin', 'password'));
6+
$util = new RouterOS\Util(
7+
$client = new RouterOS\Client('192.168.88.1', 'admin', 'password')
8+
);
69
$util->setMenu('/ip arp');
710
$util->remove(0);
811
$util->disable(Query::where('comment', 'DISABLE ME'));
9-
$util->enable(1);
12+
$util->enable(1);

examples/Util/exec-basic.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
<?php
22
use PEAR2\Net\RouterOS;
3+
34
require_once 'PEAR2/Autoload.php';
45

5-
$util = new RouterOS\Util($client = new RouterOS\Client('192.168.88.1', 'admin', 'password'));
6+
$util = new RouterOS\Util(
7+
$client = new RouterOS\Client('192.168.88.1', 'admin', 'password')
8+
);
69
$util->setMenu('/ip arp');
710

8-
$util->exec('
11+
$util->exec(
12+
'
913
add address=192.168.88.100 mac-address=00:00:00:00:00:01 comment=customer_1
1014
add address=192.168.88.101 mac-address=00:00:00:00:00:02 comment=customer_2
1115
/tool
1216
fetch url="http://example.com/?name=customer_1"
1317
fetch url="http://example.com/?name=customer_2"
14-
');
18+
'
19+
);

examples/Util/exec-params.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<?php
22
use PEAR2\Net\RouterOS;
3+
34
require_once 'PEAR2/Autoload.php';
45

5-
$util = new RouterOS\Util($client = new RouterOS\Client('192.168.88.1', 'admin', 'password'));
6+
$util = new RouterOS\Util(
7+
$client = new RouterOS\Client('192.168.88.1', 'admin', 'password')
8+
);
69
$util->setMenu('/ip arp');
710

811
$source = '
@@ -25,4 +28,4 @@
2528
'mac' => '02',
2629
'name' => 'customer_2'
2730
)
28-
);
31+
);

examples/Util/exec-policy.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
<?php
22
use PEAR2\Net\RouterOS;
3+
34
require_once 'PEAR2/Autoload.php';
45

5-
$util = new RouterOS\Util($client = new RouterOS\Client('192.168.88.1', 'admin', 'password'));
6+
$util = new RouterOS\Util(
7+
$client = new RouterOS\Client('192.168.88.1', 'admin', 'password')
8+
);
69
$util->setMenu('/tool');
710

8-
$url = $_GET['url'];//assume $_GET['url'] equals something akin to "http://example.com/geoip.rsc?filter=all"...
11+
//If $_GET['url'] equals "http://example.com/geoip.rsc?filter=all"...
12+
$url = $_GET['url'];
913

1014
$source = '
1115
fetch url=$db keep-result=yes dst-path=$filename
@@ -17,7 +21,8 @@
1721
$source,
1822
array(
1923
'db' => $url,
20-
'filename' => pathinfo(parse_url($url, PHP_URL_PATH), PATHINFO_FILENAME) //... then this would be equal to "geoip.rsc"
24+
//... then this would be equal to "geoip.rsc"
25+
'filename' => pathinfo(parse_url($url, PHP_URL_PATH), PATHINFO_FILENAME)
2126
),
2227
'read,write'
23-
);
28+
);

examples/Util/file-get.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<?php
22
use PEAR2\Net\RouterOS;
3+
34
require_once 'PEAR2/Autoload.php';
45

5-
$util = new RouterOS\Util($client = new RouterOS\Client('192.168.88.1', 'admin', 'password'));
6+
$util = new RouterOS\Util(
7+
$client = new RouterOS\Client('192.168.88.1', 'admin', 'password')
8+
);
69

710
$filename = 'backup.rsc';
8-
file_put_contents($filename, $util->fileGetContents($filename));
11+
file_put_contents($filename, $util->fileGetContents($filename));

examples/Util/file-put.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<?php
22
use PEAR2\Net\RouterOS;
3+
34
require_once 'PEAR2/Autoload.php';
45

5-
$util = new RouterOS\Util($client = new RouterOS\Client('192.168.88.1', 'admin', 'password'));
6+
$util = new RouterOS\Util(
7+
$client = new RouterOS\Client('192.168.88.1', 'admin', 'password')
8+
);
69

710
$filename = 'backup.auto.rsc';
8-
$util->filePutContents($filename, file_get_contents($filename));
11+
$util->filePutContents($filename, file_get_contents($filename));

examples/Util/find-callback.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
<?php
22
use PEAR2\Net\RouterOS;
3+
34
require_once 'PEAR2/Autoload.php';
45

5-
$util = new RouterOS\Util($client = new RouterOS\Client('192.168.88.1', 'admin', 'password'));
6+
$util = new RouterOS\Util(
7+
$client = new RouterOS\Client('192.168.88.1', 'admin', 'password')
8+
);
69
$util->changeMenu('/ip arp');
7-
echo $util->find(function ($response) {
8-
return preg_match('/^\d\d/', $response->getArgument('comment'));//Matches any entry who's comment starts with two digits
9-
});
10+
echo $util->find(
11+
function ($response) {
12+
//Matches any item with a comment that starts with two digits
13+
return preg_match('/^\d\d/', $response->getArgument('comment'));
14+
}
15+
);

examples/Util/find-numbers.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
<?php
22
use PEAR2\Net\RouterOS;
3+
34
require_once 'PEAR2/Autoload.php';
45

5-
$util = new RouterOS\Util($client = new RouterOS\Client('192.168.88.1', 'admin', 'password'));
6+
$util = new RouterOS\Util(
7+
$client = new RouterOS\Client('192.168.88.1', 'admin', 'password')
8+
);
69
$util->setMenu('/ip arp');
7-
echo $util->find(0, 1);//Outputs something similar to "*4de,*16a", since we targeted two entries - the one in position 0 and position 1.
10+
11+
//Outputs something similar to "*4de,*16a", since we targeted two entries:
12+
//the one in position 0 and position 1.
13+
echo $util->find(0, 1);

0 commit comments

Comments
 (0)