@@ -21,8 +21,8 @@ |
||
| 21 | 21 | /** |
| 22 | 22 | * List all backups on the current account. |
| 23 | 23 | * |
| 24 | - * @param int $sub_id Filter result set to only contain backups of this subscription object |
|
| 25 | - * @param string $backup_id filter result set to only contain this backup |
|
| 24 | + * @param int $subId Filter result set to only contain backups of this subscription object |
|
| 25 | + * @param string $backupId filter result set to only contain this backup |
|
| 26 | 26 | * |
| 27 | 27 | * @return BackupEntity |
| 28 | 28 | */ |
@@ -82,9 +82,8 @@ discard block |
||
| 82 | 82 | /** |
| 83 | 83 | * Convert an existing IP on a subscription to a reserved IP. |
| 84 | 84 | * |
| 85 | - * @param int $serverId SUBID of the server that currently has the IP address |
|
| 85 | + * @param int $serverIdd SUBID of the server that currently has the IP address |
|
| 86 | 86 | * @param string $ipAddress IP address you want to convert |
| 87 | - * @param string $paramname Label for this reserved IP |
|
| 88 | 87 | * |
| 89 | 88 | * @throws HttpException |
| 90 | 89 | */ |
@@ -108,7 +107,7 @@ discard block |
||
| 108 | 107 | * |
| 109 | 108 | * @throws HttpException |
| 110 | 109 | * |
| 111 | - * @return ActionEntity |
|
| 110 | + * @return string |
|
| 112 | 111 | */ |
| 113 | 112 | public function attach($ipAddress, $serverId) |
| 114 | 113 | { |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | $this->extractMeta($ips); |
| 32 | 32 | |
| 33 | - return \array_map(function ($ip) { |
|
| 33 | + return \array_map(function($ip) { |
|
| 34 | 34 | return new ReservedIpEntity($ip); |
| 35 | 35 | }, $ips); |
| 36 | 36 | } |
@@ -135,6 +135,6 @@ discard block |
||
| 135 | 135 | */ |
| 136 | 136 | private function executeAction($ipAddress, $serverId, $action) |
| 137 | 137 | { |
| 138 | - return $this->adapter->post(\sprintf('%s/reservedip/' . $action, $this->endpoint), ['ip_address' => $ipAddress, 'attach_SUBID' => $serverId]); |
|
| 138 | + return $this->adapter->post(\sprintf('%s/reservedip/'.$action, $this->endpoint), ['ip_address' => $ipAddress, 'attach_SUBID' => $serverId]); |
|
| 139 | 139 | } |
| 140 | 140 | } |
@@ -28,6 +28,9 @@ |
||
| 28 | 28 | Mockery::close(); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | + /** |
|
| 32 | + * @return AdapterInterface |
|
| 33 | + */ |
|
| 31 | 34 | protected function getRequest() |
| 32 | 35 | { |
| 33 | 36 | return Mockery::mock(AdapterInterface::class)->shouldReceive('get')->andReturn($this->getResponse())->mock(); |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | |
| 28 | 28 | $blocks = \json_decode($blocks, true); |
| 29 | 29 | |
| 30 | - return \array_map(function ($block) { |
|
| 30 | + return \array_map(function($block) { |
|
| 31 | 31 | return new BlockEntity($block); |
| 32 | 32 | }, $blocks); |
| 33 | 33 | } |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | public function list($groupId, $direction, $ipType) |
| 27 | 27 | { |
| 28 | 28 | $params = 'FIREWALLGROUPID=%s&direction=%s&ip_type=%s'; |
| 29 | - $response = $this->adapter->get(\sprintf('%s/firewall/rule_list' . $params, $this->endpoint, $groupId, $direction, $ipType)); |
|
| 29 | + $response = $this->adapter->get(\sprintf('%s/firewall/rule_list'.$params, $this->endpoint, $groupId, $direction, $ipType)); |
|
| 30 | 30 | |
| 31 | 31 | return $this->handleResponse($response, self::class, true); |
| 32 | 32 | } |
@@ -34,14 +34,14 @@ discard block |
||
| 34 | 34 | $url = \sprintf('%s/droplets?per_page=%d&page=%d', $this->endpoint, $per_page, $page); |
| 35 | 35 | |
| 36 | 36 | if (null !== $tag) { |
| 37 | - $url .= '&tag_name=' . $tag; |
|
| 37 | + $url .= '&tag_name='.$tag; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | $droplets = \json_decode($this->adapter->get($url)); |
| 41 | 41 | |
| 42 | 42 | $this->extractMeta($droplets); |
| 43 | 43 | |
| 44 | - return \array_map(function ($droplet) { |
|
| 44 | + return \array_map(function($droplet) { |
|
| 45 | 45 | return new DropletEntity($droplet); |
| 46 | 46 | }, $droplets->droplets); |
| 47 | 47 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | $droplets = \json_decode($droplets); |
| 59 | 59 | |
| 60 | - return \array_map(function ($droplet) { |
|
| 60 | + return \array_map(function($droplet) { |
|
| 61 | 61 | return new DropletEntity($droplet); |
| 62 | 62 | }, $droplets->droplets); |
| 63 | 63 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | $neighbors = \json_decode($neighbors); |
| 73 | 73 | |
| 74 | - return \array_map(function ($neighbor) { |
|
| 74 | + return \array_map(function($neighbor) { |
|
| 75 | 75 | return new DropletEntity($neighbor); |
| 76 | 76 | }, $neighbors->neighbors); |
| 77 | 77 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | $upgrades = \json_decode($upgrades); |
| 87 | 87 | |
| 88 | - return \array_map(function ($upgrade) { |
|
| 88 | + return \array_map(function($upgrade) { |
|
| 89 | 89 | return new UpgradeEntity($upgrade); |
| 90 | 90 | }, $upgrades); |
| 91 | 91 | } |
@@ -126,8 +126,8 @@ discard block |
||
| 126 | 126 | $optional = [ |
| 127 | 127 | 'ipxe_chain_url', |
| 128 | 128 | 'ISOID', |
| 129 | - 'SCRIPTID' , |
|
| 130 | - 'SNAPSHOTID' , |
|
| 129 | + 'SCRIPTID', |
|
| 130 | + 'SNAPSHOTID', |
|
| 131 | 131 | 'enable_ipv6', |
| 132 | 132 | 'enable_private_network', |
| 133 | 133 | 'label', |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | $droplet = \json_decode($droplet); |
| 153 | 153 | |
| 154 | 154 | if (\is_array($names)) { |
| 155 | - return \array_map(function ($droplet) { |
|
| 155 | + return \array_map(function($droplet) { |
|
| 156 | 156 | return new DropletEntity($droplet); |
| 157 | 157 | }, $droplet->droplets); |
| 158 | 158 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | |
| 186 | 186 | $this->meta = $this->extractMeta($kernels); |
| 187 | 187 | |
| 188 | - return \array_map(function ($kernel) { |
|
| 188 | + return \array_map(function($kernel) { |
|
| 189 | 189 | return new KernelEntity($kernel); |
| 190 | 190 | }, $kernels->kernels); |
| 191 | 191 | } |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | |
| 204 | 204 | $this->meta = $this->extractMeta($snapshots); |
| 205 | 205 | |
| 206 | - return \array_map(function ($snapshot) { |
|
| 206 | + return \array_map(function($snapshot) { |
|
| 207 | 207 | $snapshot = new ImageEntity($snapshot); |
| 208 | 208 | |
| 209 | 209 | return $snapshot; |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | |
| 224 | 224 | $this->meta = $this->extractMeta($backups); |
| 225 | 225 | |
| 226 | - return \array_map(function ($backup) { |
|
| 226 | + return \array_map(function($backup) { |
|
| 227 | 227 | return new ImageEntity($backup); |
| 228 | 228 | }, $backups->backups); |
| 229 | 229 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | |
| 242 | 242 | $this->meta = $this->extractMeta($actions); |
| 243 | 243 | |
| 244 | - return \array_map(function ($action) { |
|
| 244 | + return \array_map(function($action) { |
|
| 245 | 245 | return new ActionEntity($action); |
| 246 | 246 | }, $actions->actions); |
| 247 | 247 | } |
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | public function update($domain, $recordId, $name = null, $data = null, $priority = null, $ttl = null) |
| 95 | 95 | { |
| 96 | 96 | $content = \compact('name', 'data', 'priority', 'ttl', 'domain'); |
| 97 | - $content = \array_filter($content, function ($val) { |
|
| 97 | + $content = \array_filter($content, function($val) { |
|
| 98 | 98 | return $val !== null; |
| 99 | 99 | }); |
| 100 | 100 | $content['RECORDID'] = $recordId; |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | { |
| 56 | 56 | $object = \json_decode($response, true); |
| 57 | 57 | if ($isArray) { |
| 58 | - return \array_map(function ($entity) use ($class) { |
|
| 58 | + return \array_map(function($entity) use ($class) { |
|
| 59 | 59 | return new $class($entity); |
| 60 | 60 | }, $object); |
| 61 | 61 | } |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | |
| 28 | 28 | $this->extractMeta($regions); |
| 29 | 29 | |
| 30 | - return \array_map(function ($region) { |
|
| 30 | + return \array_map(function($region) { |
|
| 31 | 31 | return new RegionEntity($region); |
| 32 | 32 | }, $regions->regions); |
| 33 | 33 | } |