| Total Complexity | 3 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class Network extends AbstractNetwork |
||
| 13 | { |
||
| 14 | /** @var string */ |
||
| 15 | protected const POSITIVE_CONNECTION_FLAG = 'yes'; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param string $password |
||
| 19 | * @param string $device |
||
| 20 | * |
||
| 21 | * @throws \Exception |
||
| 22 | */ |
||
| 23 | public function connect(string $password, string $device): void |
||
| 24 | { |
||
| 25 | $format = 'LANG=C nmcli -w 10 device wifi connect "%s" password "%s" ifname "%s"'; |
||
| 26 | |||
| 27 | $this->getCommand()->execute(sprintf($format, $this->ssid, $password, $device)); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param string $device |
||
| 32 | * |
||
| 33 | * @throws \Exception |
||
| 34 | */ |
||
| 35 | public function disconnect(string $device): void |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @param array $network |
||
| 42 | * |
||
| 43 | * @return \Sanchescom\WiFi\System\Linux\Network |
||
| 44 | */ |
||
| 45 | public function createFromArray(array $network): AbstractNetwork |
||
| 58 | } |
||
| 59 | } |
||
| 60 |