mode, [self::NONE, self::IF_ABSENT, self::IF_MATCH], true)) { throw new InvalidArgumentException('Invalid system-store write condition: ' . $this->mode); } if ($this->mode === self::IF_MATCH && ($this->etag === null || $this->etag === '')) { throw new InvalidArgumentException('An ETag is required for an if-match condition'); } if ($this->mode !== self::IF_MATCH && $this->etag !== null) { throw new InvalidArgumentException('An ETag is only valid for an if-match condition'); } } public static function none(): self { return new self(self::NONE); } public static function ifAbsent(): self { return new self(self::IF_ABSENT); } public static function ifMatch(string $etag): self { return new self(self::IF_MATCH, $etag); } }