@@ -56,6 +56,9 @@ |
||
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | + /** |
|
| 60 | + * @param string $data |
|
| 61 | + */ |
|
| 59 | 62 | private function write($data) |
| 60 | 63 | { |
| 61 | 64 | if (false === @fwrite($this->socket, $data)) { |
@@ -57,6 +57,9 @@ discard block |
||
| 57 | 57 | /** @var array */ |
| 58 | 58 | private $instances; |
| 59 | 59 | |
| 60 | + /** |
|
| 61 | + * @param integer $poolNumber |
|
| 62 | + */ |
|
| 60 | 63 | public function __construct($poolNumber, array $poolData) |
| 61 | 64 | { |
| 62 | 65 | $this->setId(self::validate($poolData, 'id')); |
@@ -248,6 +251,7 @@ discard block |
||
| 248 | 251 | * |
| 249 | 252 | * A /24 or 'bigger' will be split in 4 networks, everything 'smaller' |
| 250 | 253 | * will be either be split in 2 networks or remain 1 network. |
| 254 | + * @param integer $prefix |
|
| 251 | 255 | */ |
| 252 | 256 | private static function getNetCount($prefix) |
| 253 | 257 | { |
@@ -302,6 +306,9 @@ discard block |
||
| 302 | 306 | ]; |
| 303 | 307 | } |
| 304 | 308 | |
| 309 | + /** |
|
| 310 | + * @param string $configName |
|
| 311 | + */ |
|
| 305 | 312 | private static function validate(array $configData, $configName, $requiredField = true, $defaultValue = false) |
| 306 | 313 | { |
| 307 | 314 | if (!array_key_exists($configName, $configData)) { |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | $service->get( |
| 40 | 40 | '/openvpn/connections', |
| 41 | - function (Request $request, TokenInfo $tokenInfo) { |
|
| 41 | + function(Request $request, TokenInfo $tokenInfo) { |
|
| 42 | 42 | $tokenInfo->getScope()->requireScope(['admin']); |
| 43 | 43 | |
| 44 | 44 | $response = new JsonResponse(); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | $service->post( |
| 52 | 52 | '/openvpn/kill', |
| 53 | - function (Request $request, TokenInfo $tokenInfo) { |
|
| 53 | + function(Request $request, TokenInfo $tokenInfo) { |
|
| 54 | 54 | $tokenInfo->getScope()->requireScope(['admin', 'portal']); |
| 55 | 55 | |
| 56 | 56 | $commonName = $request->getPostParameter('common_name'); |