update patch 1
This commit is contained in:
+5
-5
@@ -170,7 +170,7 @@ final class Headers
|
||||
$name = strtolower($header->getName());
|
||||
|
||||
if (\in_array($name, self::UNIQUE_HEADERS, true) && isset($this->headers[$name]) && \count($this->headers[$name]) > 0) {
|
||||
throw new LogicException(sprintf('Impossible to set header "%s" as it\'s already defined and must be unique.', $header->getName()));
|
||||
throw new LogicException(\sprintf('Impossible to set header "%s" as it\'s already defined and must be unique.', $header->getName()));
|
||||
}
|
||||
|
||||
$this->headers[$name][] = $header;
|
||||
@@ -241,7 +241,7 @@ final class Headers
|
||||
}
|
||||
}
|
||||
|
||||
throw new LogicException(sprintf('The "%s" header must be an instance of "%s" (got "%s").', $header->getName(), implode('" or "', $headerClasses), get_debug_type($header)));
|
||||
throw new LogicException(\sprintf('The "%s" header must be an instance of "%s" (got "%s").', $header->getName(), implode('" or "', $headerClasses), get_debug_type($header)));
|
||||
}
|
||||
|
||||
public function toString(): string
|
||||
@@ -291,7 +291,7 @@ final class Headers
|
||||
|
||||
$header = $this->get($name);
|
||||
if (!$header instanceof ParameterizedHeader) {
|
||||
throw new LogicException(sprintf('Unable to get parameter "%s" on header "%s" as the header is not of class "%s".', $parameter, $name, ParameterizedHeader::class));
|
||||
throw new LogicException(\sprintf('Unable to get parameter "%s" on header "%s" as the header is not of class "%s".', $parameter, $name, ParameterizedHeader::class));
|
||||
}
|
||||
|
||||
return $header->getParameter($parameter);
|
||||
@@ -303,12 +303,12 @@ final class Headers
|
||||
public function setHeaderParameter(string $name, string $parameter, ?string $value): void
|
||||
{
|
||||
if (!$this->has($name)) {
|
||||
throw new LogicException(sprintf('Unable to set parameter "%s" on header "%s" as the header is not defined.', $parameter, $name));
|
||||
throw new LogicException(\sprintf('Unable to set parameter "%s" on header "%s" as the header is not defined.', $parameter, $name));
|
||||
}
|
||||
|
||||
$header = $this->get($name);
|
||||
if (!$header instanceof ParameterizedHeader) {
|
||||
throw new LogicException(sprintf('Unable to set parameter "%s" on header "%s" as the header is not of class "%s".', $parameter, $name, ParameterizedHeader::class));
|
||||
throw new LogicException(\sprintf('Unable to set parameter "%s" on header "%s" as the header is not of class "%s".', $parameter, $name, ParameterizedHeader::class));
|
||||
}
|
||||
|
||||
$header->setParameter($parameter, $value);
|
||||
|
||||
+2
-2
@@ -162,9 +162,9 @@ final class ParameterizedHeader extends UnstructuredHeader
|
||||
}
|
||||
|
||||
return implode(";\r\n ", $paramLines);
|
||||
} else {
|
||||
return $name.$this->getEndOfParameterValue($valueLines[0], $encoded, true);
|
||||
}
|
||||
|
||||
return $name.$this->getEndOfParameterValue($valueLines[0], $encoded, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user