Skip to content

Commit

Permalink
Merge pull request #88 from JinTotonic/jindun
Browse files Browse the repository at this point in the history
Remove needVirtualHost in Service
  • Loading branch information
moufmouf committed Aug 7, 2018
2 parents 8b1de7c + b647aa6 commit 949a114
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 20 deletions.
15 changes: 0 additions & 15 deletions src/Service/Service.php
Expand Up @@ -36,8 +36,6 @@ class Service implements \JsonSerializable
private $environment = [];
/** @var mixed[] */
private $volumes = [];
/** @var null|bool */
private $needVirtualHost;
/** @var array<int, array<string, string|int>> */
private $virtualHosts = [];
/** @var null|bool */
Expand Down Expand Up @@ -95,7 +93,6 @@ public static function parsePayload(array $payload): Service
foreach ($volumes as $vol) {
$service->addVolume($vol['type'], $vol['source'], $vol['comment'] ?? null, $vol['target'] ?? '', $vol['readOnly'] ?? false);
}
$service->needVirtualHost = $s['needVirtualHost'] ?? null;
$service->virtualHosts = $s['virtualHosts'] ?? [];
$service->needBuild = $s['needBuild'] ?? null;
}
Expand Down Expand Up @@ -151,7 +148,6 @@ public function jsonSerialize(): array
'labels' => array_map($labelMap, $this->labels),
'environment' => array_map($jsonSerializeMap, $this->environment),
'volumes' => array_map($jsonSerializeMap, $this->volumes),
'needVirtualHost' => $this->needVirtualHost,
'virtualHosts' => $this->virtualHosts,
'needBuild' => $this->needBuild,
]);
Expand Down Expand Up @@ -290,11 +286,6 @@ public function getVolumes(): array
return $this->volumes;
}

public function getNeedVirtualHost(): ?bool
{
return $this->needVirtualHost;
}

/** @return array<int, array<string, string|int>> */
public function getVirtualHosts(): array
{
Expand Down Expand Up @@ -399,11 +390,6 @@ public function setLimitCpu(string $limitCpu): void
$this->limitCpu = $limitCpu;
}

public function setNeedVirtualHost(?bool $needVirtualHost): void
{
$this->needVirtualHost = $needVirtualHost;
}

public function setNeedBuild(?bool $needBuild): void
{
$this->needBuild = $needBuild;
Expand Down Expand Up @@ -445,7 +431,6 @@ public function addLabel(string $key, string $value, ?string $comment = null): v

public function addVirtualHost(?string $host, int $port, ?string $comment): void
{
$this->needVirtualHost = true;
$array = [];
if (null !== $host && '' !== $host) {
$array['host'] = $host;
Expand Down
3 changes: 0 additions & 3 deletions src/Service/ServiceJsonSchema.json
Expand Up @@ -139,9 +139,6 @@
"additionalProperties": false
}
},
"needVirtualHost": {
"type": "boolean"
},
"needBuild": {
"type": "boolean"
},
Expand Down
2 changes: 0 additions & 2 deletions tests/Service/ServiceTest.php
Expand Up @@ -36,7 +36,6 @@ class ServiceTest extends TestCase
{"type": "bind", "source": "/bar", "target": "/bar", "readOnly": false, "comment": "a bind volume"},
{"type": "tmpfs", "source": "baz", "comment": "a tmpfs"}
],
"needVirtualHost": true,
"virtualHosts": [
{"host": "foo", "port": 80, "comment": "a default virtual host"},
{"port": 8080, "comment": "it's ok"}
Expand Down Expand Up @@ -158,7 +157,6 @@ public function testSettersAndAdders(): void
$s->addBindVolume('/bar', '/bar', false, 'a bind volume');
$s->addTmpfsVolume('baz', 'a tmpfs');
$s->addDockerfileCommand('RUN composer install');
$s->setNeedVirtualHost(true);
$s->addVirtualHost('foo', 80, 'a default virtual host');
$s->addVirtualHost(null, 8080, "it's ok");
$s->setNeedBuild(true);
Expand Down

0 comments on commit 949a114

Please sign in to comment.