| Total Complexity | 5 |
| Total Lines | 100 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | abstract class AbstractNetwork |
||
| 11 | { |
||
| 12 | /** @var string */ |
||
| 13 | public $bssid; |
||
| 14 | |||
| 15 | /** @var string */ |
||
| 16 | public $ssid; |
||
| 17 | |||
| 18 | /** @var int */ |
||
| 19 | public $channel; |
||
| 20 | |||
| 21 | /** @var float */ |
||
| 22 | public $quality; |
||
| 23 | |||
| 24 | /** @var float */ |
||
| 25 | public $dbm; |
||
| 26 | |||
| 27 | /** @var string */ |
||
| 28 | public $security; |
||
| 29 | |||
| 30 | /** @var string */ |
||
| 31 | public $securityFlags; |
||
| 32 | |||
| 33 | /** @var int */ |
||
| 34 | public $frequency; |
||
| 35 | |||
| 36 | /** @var bool */ |
||
| 37 | public $connected; |
||
| 38 | |||
| 39 | /** @var array */ |
||
| 40 | protected static $securityTypes = [ |
||
| 41 | 'WPA2', |
||
| 42 | 'WPA', |
||
| 43 | 'WEP', |
||
| 44 | ]; |
||
| 45 | |||
| 46 | /** @var Command */ |
||
| 47 | protected $command; |
||
| 48 | |||
| 49 | /** |
||
| 50 | * AbstractNetwork constructor. |
||
| 51 | * |
||
| 52 | * @param Command $command |
||
| 53 | */ |
||
| 54 | public function __construct(Command $command) |
||
| 55 | { |
||
| 56 | $this->command = $command; |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @return string |
||
| 61 | */ |
||
| 62 | public function getSecurityType(): string |
||
| 73 | } |
||
| 74 | |||
| 75 | /** |
||
| 76 | * @return string |
||
| 77 | */ |
||
| 78 | public function __toString(): string |
||
| 89 | ]); |
||
| 90 | } |
||
| 91 | |||
| 92 | /** |
||
| 93 | * @param string $password |
||
| 94 | * @param string $device |
||
| 95 | */ |
||
| 96 | abstract public function connect(string $password, string $device): void; |
||
| 97 | |||
| 98 | /** |
||
| 99 | * @param string $device |
||
| 100 | */ |
||
| 101 | abstract public function disconnect(string $device): void; |
||
| 102 | |||
| 103 | /** |
||
| 104 | * @param array $network |
||
| 105 | * @param Command $command |
||
| 106 | * |
||
| 107 | * @return AbstractNetwork |
||
| 108 | */ |
||
| 109 | abstract public function createFromArray(array $network, Command $command): self; |
||
| 110 | } |
||
| 111 |