diff --git a/src/Service/Service.php b/src/Service/Service.php index e8d7d72..8ec091b 100644 --- a/src/Service/Service.php +++ b/src/Service/Service.php @@ -36,8 +36,6 @@ class Service implements \JsonSerializable private $environment = []; /** @var mixed[] */ private $volumes = []; - /** @var null|bool */ - private $needVirtualHost; /** @var array> */ private $virtualHosts = []; /** @var null|bool */ @@ -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; } @@ -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, ]); @@ -290,11 +286,6 @@ public function getVolumes(): array return $this->volumes; } - public function getNeedVirtualHost(): ?bool - { - return $this->needVirtualHost; - } - /** @return array> */ public function getVirtualHosts(): array { @@ -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; @@ -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; diff --git a/src/Service/ServiceJsonSchema.json b/src/Service/ServiceJsonSchema.json index db4bce8..4eee31a 100644 --- a/src/Service/ServiceJsonSchema.json +++ b/src/Service/ServiceJsonSchema.json @@ -139,9 +139,6 @@ "additionalProperties": false } }, - "needVirtualHost": { - "type": "boolean" - }, "needBuild": { "type": "boolean" }, diff --git a/tests/Service/ServiceTest.php b/tests/Service/ServiceTest.php index 5fb8885..55cbfd9 100644 --- a/tests/Service/ServiceTest.php +++ b/tests/Service/ServiceTest.php @@ -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"} @@ -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);