@@ -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 | /** |
@@ -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 | } |
@@ -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; |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | { |
| 52 | 52 | $availableNetworks = $this->explodeAvailableNetworks($output); |
| 53 | 53 | |
| 54 | - array_walk($availableNetworks, function (&$networkData) { |
|
| 54 | + array_walk($availableNetworks, function(&$networkData) { |
|
| 55 | 55 | $networkData = $this->extractingDataFromString($networkData); |
| 56 | 56 | }); |
| 57 | 57 | |
@@ -47,12 +47,12 @@ |
||
| 47 | 47 | { |
| 48 | 48 | $this->ssid = $network[1]; |
| 49 | 49 | $this->bssid = $network[2]; |
| 50 | - $this->channel = (int) $network[4]; |
|
| 50 | + $this->channel = (int)$network[4]; |
|
| 51 | 51 | $this->security = $network[7]; |
| 52 | - $this->securityFlags = $network[8].' '.$network[9]; |
|
| 52 | + $this->securityFlags = $network[8] . ' ' . $network[9]; |
|
| 53 | 53 | $this->dbm = $network[6]; |
| 54 | 54 | $this->quality = to_quality($network[6]); |
| 55 | - $this->frequency = (int) $network[5]; |
|
| 55 | + $this->frequency = (int)$network[5]; |
|
| 56 | 56 | $this->connected = ($network[0] == self::POSITIVE_CONNECTION_FLAG); |
| 57 | 57 | |
| 58 | 58 | return $this; |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | */ |
| 70 | 70 | protected function setNetworks(array $networks): void |
| 71 | 71 | { |
| 72 | - $this->networks = array_map(function (array $network) { |
|
| 72 | + $this->networks = array_map(function(array $network) { |
|
| 73 | 73 | return $this->getNetwork()->createFromArray($network); |
| 74 | 74 | }, $networks); |
| 75 | 75 | } |
@@ -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( |