@@ -10,7 +10,7 @@ |
||
10 | 10 | */ |
11 | 11 | function trim_first(array $array): array |
12 | 12 | { |
13 | - array_walk($array, function (&$item) { |
|
13 | + array_walk($array, function(&$item) { |
|
14 | 14 | list($firstElement) = $item; |
15 | 15 | |
16 | 16 | $item = trim($firstElement); |
@@ -37,7 +37,7 @@ |
||
37 | 37 | $hex = ''; |
38 | 38 | |
39 | 39 | for ($i = 0; $i < $len; $i++) { |
40 | - $hex .= substr('0'.dechex(ord($string[$i])), -2); |
|
40 | + $hex .= substr('0' . dechex(ord($string[$i])), -2); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | return strtoupper($hex); |
@@ -16,6 +16,6 @@ |
||
16 | 16 | */ |
17 | 17 | public function __construct() |
18 | 18 | { |
19 | - parent::__construct("Operation system doesn't support: ".PHP_OS); |
|
19 | + parent::__construct("Operation system doesn't support: " . PHP_OS); |
|
20 | 20 | } |
21 | 21 | } |
@@ -30,9 +30,9 @@ |
||
30 | 30 | public function __construct(string $command, string $output, int $returnCode) |
31 | 31 | { |
32 | 32 | if ($this->returnCode == 127) { |
33 | - $message = 'Command not found: "'.$command.'"'; |
|
33 | + $message = 'Command not found: "' . $command . '"'; |
|
34 | 34 | } else { |
35 | - $message = 'Command "'.$command.'" exited with code '.$returnCode.': '.$output; |
|
35 | + $message = 'Command "' . $command . '" exited with code ' . $returnCode . ': ' . $output; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | parent::__construct($message); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | protected function getTmpFileName(): string |
64 | 64 | { |
65 | - return __DIR__.'/../../../tmp/'.$this->ssid.'.xml'; |
|
65 | + return __DIR__ . '/../../../tmp/' . $this->ssid . '.xml'; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | protected function getTemplateFileName(): string |
72 | 72 | { |
73 | - return __DIR__.'/../../../templates/'.$this->securityType.'.xml'; |
|
73 | + return __DIR__ . '/../../../templates/' . $this->securityType . '.xml'; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -52,12 +52,12 @@ |
||
52 | 52 | { |
53 | 53 | $this->ssid = $network[0]; |
54 | 54 | $this->bssid = $network[4]; |
55 | - $this->channel = (int) $network[7]; |
|
55 | + $this->channel = (int)$network[7]; |
|
56 | 56 | $this->security = $network[2]; |
57 | 57 | $this->securityFlags = $network[3]; |
58 | - $this->quality = (int) $network[5]; |
|
58 | + $this->quality = (int)$network[5]; |
|
59 | 59 | $this->frequency = $this->getFrequency(); |
60 | - $this->dbm = to_dbm((int) $network[5]); |
|
60 | + $this->dbm = to_dbm((int)$network[5]); |
|
61 | 61 | $this->connected = isset($network[10]); |
62 | 62 | |
63 | 63 | return $this; |
@@ -53,12 +53,12 @@ |
||
53 | 53 | { |
54 | 54 | $this->ssid = $network[0]; |
55 | 55 | $this->bssid = $network[1]; |
56 | - $this->channel = (int) $network[3]; |
|
56 | + $this->channel = (int)$network[3]; |
|
57 | 57 | $this->security = $network[6]; |
58 | 58 | $this->securityFlags = $network[5]; |
59 | 59 | $this->quality = $network[2]; |
60 | 60 | $this->frequency = $this->getFrequency(); |
61 | - $this->dbm = to_dbm((int) $network[2]); |
|
61 | + $this->dbm = to_dbm((int)$network[2]); |
|
62 | 62 | $this->connected = isset($network[7]); |
63 | 63 | |
64 | 64 | return $this; |
@@ -38,7 +38,7 @@ |
||
38 | 38 | return glue_commands( |
39 | 39 | 'chcp 65001', |
40 | 40 | 'netsh wlan show networks mode=Bssid', |
41 | - 'echo '.$this->separator, |
|
41 | + 'echo ' . $this->separator, |
|
42 | 42 | 'netsh wlan show interfaces' |
43 | 43 | ); |
44 | 44 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | array_shift($availableNetworks); |
55 | 55 | |
56 | - array_walk($availableNetworks, function (&$networkData) use ($currentBssid) { |
|
56 | + array_walk($availableNetworks, function(&$networkData) use ($currentBssid) { |
|
57 | 57 | $networkData = $this->extractingDataFromString($networkData); |
58 | 58 | |
59 | 59 | if (in_array($networkData[self::BSSID_KEY], $currentBssid)) { |
@@ -73,12 +73,12 @@ discard block |
||
73 | 73 | { |
74 | 74 | $extractedProperties = []; |
75 | 75 | |
76 | - $pattern = '/(.*?)'. |
|
77 | - '(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})\s{1,}'. |
|
78 | - '([-+]?[0-9]*)\s{1,}'. |
|
79 | - '([^a-zA-Z]*)'. |
|
80 | - '(\w{1,})\s{1,}'. |
|
81 | - '([\w-]+)'. |
|
76 | + $pattern = '/(.*?)' . |
|
77 | + '(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})\s{1,}' . |
|
78 | + '([-+]?[0-9]*)\s{1,}' . |
|
79 | + '([^a-zA-Z]*)' . |
|
80 | + '(\w{1,})\s{1,}' . |
|
81 | + '([\w-]+)' . |
|
82 | 82 | '(.*)/'; |
83 | 83 | |
84 | 84 | preg_match_all( |